Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring of Aggregations #14136

Merged
merged 78 commits into from Feb 15, 2016
Merged

Refactoring of Aggregations #14136

merged 78 commits into from Feb 15, 2016

Conversation

colings86
Copy link
Contributor

This PR refactors all aggregations to be able to be parsed on the coordinating node and serialised as Objects to the shards.

@@ -150,15 +144,29 @@ public Builder addPipelineAggregator(PipelineAggregatorFactory pipelineAggregato
return this;
}

/**
* FOR TESTING ONLY
Copy link
Contributor

Choose a reason for hiding this comment

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

can it be pkg-private then?

@jpountz
Copy link
Contributor

jpountz commented Oct 30, 2015

Things look good. Can you just explain why we need this new "init" phase?

@colings86 colings86 force-pushed the feature/aggs-refactoring branch 9 times, most recently from fe4875b to 62c387f Compare November 10, 2015 09:27
@colings86
Copy link
Contributor Author

@jpountz I pushed a some updates. could you re-review?

As to the "init" phase, this is needed to be able to run things that used to be done in the constructor but now can't be because:

  1. Not all settings for the aggregator factory will be set in the constructor
  2. The aggregator factory will be constructed on the coordinating node but that is some initialisation (see ParentToChildAggregator for an example) that has to be done on the shard where we have the mappings etc.

I thought it was neater to have an "init" phase than to duplicate calls to initialise in the different create() methods

@colings86 colings86 force-pushed the feature/aggs-refactoring branch 3 times, most recently from 4a4be91 to 4ffd006 Compare November 11, 2015 11:08
# Conflicts:
#	core/src/main/java/org/elasticsearch/percolator/PercolateContext.java
#	core/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterParser.java
#	core/src/main/java/org/elasticsearch/search/aggregations/bucket/filters/FiltersParser.java
#	core/src/main/java/org/elasticsearch/search/aggregations/bucket/significant/SignificantTermsParametersParser.java
#	core/src/main/java/org/elasticsearch/search/internal/DefaultSearchContext.java
#	core/src/test/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridParserTests.java
#	test/framework/src/main/java/org/elasticsearch/test/TestSearchContext.java
Also renames all the implementations appropriately
# Conflicts:
#	core/src/main/java/org/elasticsearch/search/SearchService.java
#	test/framework/src/main/java/org/elasticsearch/search/MockSearchService.java
@colings86 colings86 removed the WIP label Feb 12, 2016
@@ -51,7 +52,8 @@
private List<SortBuilder> sorts;
private Boolean trackScores;
private HighlightBuilder highlightBuilder;
private List<AbstractAggregationBuilder> aggregations;
private List<AggregatorBuilder<?>> aggregationFactorys;
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Factory/Builder/ ?

@jpountz
Copy link
Contributor

jpountz commented Feb 12, 2016

I gave a quick look and could spot a few indentation and naming inconsistencies. Otherwise it looks good!

@colings86 colings86 merged commit bd2e00d into master Feb 15, 2016
@colings86 colings86 deleted the feature/aggs-refactoring branch February 15, 2016 11:27
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Search Refactoring labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v5.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants