-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Basic thread safety for ValuesSourceRegistry #50340
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
Changes from 9 commits
290396d
4b304f8
c1b7245
487243c
151e983
f9a42f6
6250f05
d284be2
91d14fb
646a10d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,7 @@ | |
| import org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory; | ||
| import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; | ||
| import org.elasticsearch.search.aggregations.support.ValuesSourceParserHelper; | ||
| import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; | ||
| import org.elasticsearch.search.aggregations.support.ValuesSourceType; | ||
|
|
||
| import java.io.IOException; | ||
|
|
@@ -88,6 +89,14 @@ public static HistogramAggregationBuilder parse(String aggregationName, XContent | |
| return PARSER.parse(parser, new HistogramAggregationBuilder(aggregationName), null); | ||
| } | ||
|
|
||
| private static boolean wasRegistered = false; | ||
|
||
| public static void registerAggregators(ValuesSourceRegistry valuesSourceRegistry) { | ||
| if (wasRegistered == false) { | ||
| HistogramAggregatorFactory.registerAggregators(valuesSourceRegistry); | ||
| wasRegistered = true; | ||
| } | ||
| } | ||
|
|
||
| private double interval; | ||
| private double offset = 0; | ||
| private double minBound = Double.POSITIVE_INFINITY; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name seems a bit funky to me. Perhaps something like `getAggregatorRegistrar()?