Skip to content

Conversation

colings86
Copy link
Contributor

No description provided.

// NORELEASE remove this check when agg refactoring complete
if (factoryPrototype != null) {
namedWriteableRegistry.registerPrototype(AggregatorFactory.class, factoryPrototype);
if (factoryPrototypes != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if we return an array, I'd rather like to enforce it to be non-null: if you don't want to register something you can provide an empty array?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I absolutely agree. This null check is only here while there are Aggregations which are not refactored. Once the aggregation refactoring is complete this check will be removed and the method will need to return a non-null value (see NORELEASE comment above). I could go through and make all non refactored aggregation return an empty array for this method but I wanted to leave them returning null so that if this check is removed before all aggregations have been refactored we will be alerted to the factor we have not refactored one or more of the aggregations as the node will throw a NPE on start up.

Copy link
Contributor

Choose a reason for hiding this comment

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

woops, the change made me miss the norelease comment above!

@jpountz
Copy link
Contributor

jpountz commented Nov 20, 2015

LGTM in general, I just left one comment. Could you also add javadocs to the factories as they will be exposed to users?

@colings86 colings86 force-pushed the feature/aggs-refactoring branch from 8f03a9d to af625f0 Compare November 20, 2015 13:56
@colings86 colings86 merged commit 328e332 into elastic:feature/aggs-refactoring Nov 20, 2015
@colings86 colings86 deleted the enhancement/percentilesAggRefactor branch November 20, 2015 14:41
@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
:Analytics/Aggregations Aggregations >non-issue :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.

3 participants