Mark Tozzi 22c55180c1
[7.x] Backport ValuesSourceRegistry and related work ()
* Add ValuesSource Registry and associated logic ()

* Remove ValuesSourceType argument to ValuesSourceAggregationBuilder ()

* ValuesSourceRegistry Prototype ()

* Remove generics from ValuesSource related classes ()

* fix percentile aggregation tests ()

* Basic thread safety for ValuesSourceRegistry ()

* Remove target value type from ValuesSourceAggregationBuilder ()

* Cleanup default values source type ()

* CoreValuesSourceType no longer implements Writable ()

* Remove genereics & hard coded ValuesSource references from Matrix Stats ()

* Put values source types on fields ()

* Remove VST Any ()

* Rewire terms agg to use new VS registry ()

Also adds some basic AggTestCases for untested code
paths (and boilerplate for future tests once the IT are
converted over)

* Wire Cardinality aggregation to work with the ValuesSourceRegistry ()

* Wire Percentiles aggregator into new VS framework ()

This required a bit of a refactor to percentiles itself.  Before,
the Builder would switch on the chosen algo to generate an
algo-specific factory.  This doesn't work (or at least, would be
difficult) in the new VS framework.

This refactor consolidates both factories together and introduces
a PercentilesConfig object to act as a standardized way to pass
algo-specific parameters through the factory.  This object
is then used when deciding which kind of aggregator to create

Note: CoreValuesSourceType.HISTOGRAM still lives in core, and will
be moved in a subsequent PR.

* Remove generics and target value type from MultiVSAB ()

* fix checkstyle after merge ()

* Plumb ValuesSourceRegistry through to QuerySearchContext ()

* Convert RareTerms to new VS registry ()

* Wire up Value Count ()

* Wire up Max & Min aggregations ()

* ValuesSource refactoring: Wire up Sum aggregation ()

* ValuesSource refactoring: Wire up SigTerms aggregation ()

* Soft immutability for VSConfig ()

* Unmute testSupportedFieldTypes, fix Percentiles/Ranks/Terms tests ()

Also fixes Percentiles which was incorrectly specified to only accept
numeric, but in fact also accepts Boolean and Date (because those are
numeric on master - thanks `testSupportedFieldTypes` for catching it!)

* VS refactoring: Wire up stats aggregation ()

* ValuesSource refactoring: Wire up string_stats aggregation ()

* VS refactoring: Wire up median (MAD) aggregation ()

* fix valuesourcetype issue with constant_keyword field ()x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/job/RollupIndexer.java

this commit implements `getValuesSourceType` for
the ConstantKeyword field type.

master was merged into feature/extensible-values-source
introducing a new field type that was not implementing
`getValuesSourceType`.

* ValuesSource refactoring: Wire up Avg aggregation ()

* Wire PercentileRanks aggregator into new VS framework  ()

* Add a VSConfig resolver for aggregations not using the registry ()

* Vs refactor wire up ranges and date ranges ()

* Wire up geo_bounds aggregation to ValuesSourceRegistry ()

This commit updates the geo_bounds aggregation to depend
on registering itself in the ValuesSourceRegistry

relates .

* VS refactoring: convert Boxplot to new registry ()

* Wire-up geotile_grid and geohash_grid to ValuesSourceRegistry ()

This commit updates the geo*_grid aggregations to depend
on registering itself in the ValuesSourceRegistry

relates to the values-source refactoring meta issue .

* Wire-up geo_centroid agg to ValuesSourceRegistry ()

This commit updates the geo_centroid aggregation to depend
on registering itself in the ValuesSourceRegistry.

relates to the values-source refactoring meta issue .

* Fix type tests for Missing aggregation ()

* ValuesSource Refactor: move histo VSType into XPack module ()

- Introduces a new API (`getBareAggregatorRegistrar()`) which allows plugins to register aggregations against existing agg definitions defined in Core.
- This moves the histogram VSType over to XPack where it belongs. `getHistogramValues()` still remains as a Core concept
- Moves the histo-specific bits over to xpack (e.g. the actual aggregator logic). This requires extra boilerplate since we need to create a new "Analytics" Percentile/Rank aggregators to deal with the histo field. Doubly-so since percentiles/ranks are extra boiler-plate'y... should be much lighter for other aggs

* Wire up DateHistogram to the ValuesSourceRegistry ()

* Vs refactor parser cleanup ()

Co-authored-by: Zachary Tong <polyfractal@elastic.co>
Co-authored-by: Zachary Tong <zach@elastic.co>
Co-authored-by: Christos Soulios <1561376+csoulios@users.noreply.github.com>
Co-authored-by: Tal Levy <JubBoy333@gmail.com>

* First batch of easy fixes

* Remove List.of from ValuesSourceRegistry

Note that we intend to have a follow up PR dealing with the mutability
of the registry, so I didn't even try to address that here.

* More compiler fixes

* More compiler fixes

* More compiler fixes

* Precommit is happy and so am I

* Add new Core VSTs to tests

* Disabled supported type test on SigTerms until we can backport it's fix

* fix checkstyle

* Fix test failure from semantic merge issue

* Fix some metaData->metadata replacements that got lost

* Fix list of supported types for MinAggregator

* Fix list of supported types for Avg

* remove unused import

Co-authored-by: Zachary Tong <polyfractal@elastic.co>
Co-authored-by: Zachary Tong <zach@elastic.co>
Co-authored-by: Christos Soulios <1561376+csoulios@users.noreply.github.com>
Co-authored-by: Tal Levy <JubBoy333@gmail.com>
2020-04-16 16:54:46 -04:00
..