Skip to content

Conversation

@original-brownbear
Copy link
Contributor

* Follow up to elastic#32617
* Flatten redundant inner classes of `IngestService`
@original-brownbear original-brownbear added :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP v7.0.0 >refactoring v6.5.0 labels Aug 21, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple of comments, LGTM otherwise assuming pr builds pass.

private final ThreadPool threadPool;

private final StatsHolder totalStats = new StatsHolder();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove these white lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, that would be nicer => cleaning it up :)


private final PipelineStore store;
private final ThreadPool threadPool;
public void executeBulkRequest(Iterable<DocWriteRequest<?>> actionRequests,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this method need to remain public?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martijnvg it does, it's called from org.elasticsearch.action.bulk.TransportBulkAction#processBulkIndexIngestRequest.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, nevermind :)

Pipeline pipeline = store.get(pipelineId);
if (pipeline == null) {
throw new IllegalArgumentException("pipeline with id [" + pipelineId + "] does not exist");
private void innerExecute(IndexRequest indexRequest, Pipeline pipeline) throws Exception {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a more descriptive method name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martijnvg any suggestions? :)

I agree that these names are kind of meh, but note: We have a bunch of other inner* methods in this class. In the end they're all kind of redundant since they're only used in one place (at least in production code that is) each => somewhat hard to find a better name for a method that effectively only exists to shorten the code of whatever method name that comes after the inner prefix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inner method prefix was introduced to make the actual logic easier to unit test.

I was more referring to the execute part of this method, which is very generic :)
maybe innerIngest()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martijnvg I like that (innerIngest), renaming :)

@original-brownbear original-brownbear merged commit 2000787 into elastic:master Aug 21, 2018
@original-brownbear original-brownbear deleted the real-ingest-service-2 branch August 21, 2018 08:13
@original-brownbear
Copy link
Contributor Author

@martijnvg thanks for the review!

original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Aug 31, 2018
* INGEST: Simplify IngestService

* Follow up to elastic#32617
* Flatten redundant inner classes of `IngestService`
original-brownbear added a commit that referenced this pull request Sep 4, 2018
* INGEST: Simplify IngestService (#33008)
* Follow up to #32617
* Flatten redundant inner classes of `IngestService`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >refactoring v6.5.0 v7.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants