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

[7.x] Backport ValuesSourceRegistry and related work #54922

Merged
merged 21 commits into from
Apr 16, 2020

Conversation

not-napoleon
Copy link
Member

Backport of #54281

This will add the ValuesSourceRegistry to the 7.x branch

not-napoleon and others added 9 commits April 7, 2020 10:35
* Remove ValuesSourceType argument to ValuesSourceAggregationBuilder (elastic#48638)

* ValuesSourceRegistry Prototype (elastic#48758)

* Remove generics from ValuesSource related classes (elastic#49606)

* fix percentile aggregation tests (elastic#50712)

* Basic thread safety for ValuesSourceRegistry (elastic#50340)

* Remove target value type from ValuesSourceAggregationBuilder (elastic#49943)

* Cleanup default values source type (elastic#50992)

* CoreValuesSourceType no longer implements Writable (elastic#51276)

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

* Put values source types on fields (elastic#51503)

* Remove VST Any (elastic#51539)

* Rewire terms agg to use new VS registry (elastic#51182)

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 (elastic#51337)

* Wire Percentiles aggregator into new VS framework (elastic#51639)

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 (elastic#51647)

* fix checkstyle after merge (elastic#52008)

* Plumb ValuesSourceRegistry through to QuerySearchContext (elastic#51710)

* Convert RareTerms to new VS registry (elastic#52166)

* Wire up Value Count (elastic#52225)

* Wire up Max & Min aggregations (elastic#52219)

* ValuesSource refactoring: Wire up Sum aggregation (elastic#52571)

* ValuesSource refactoring: Wire up SigTerms aggregation (elastic#52590)

* Soft immutability for VSConfig (elastic#52729)

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

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 (elastic#52891)

* ValuesSource refactoring: Wire up string_stats aggregation (elastic#52875)

* VS refactoring: Wire up median (MAD) aggregation (elastic#52945)

* fix valuesourcetype issue with constant_keyword field (elastic#53041)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 (elastic#52752)

* Wire PercentileRanks aggregator into new VS framework  (elastic#51693)

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

* Vs refactor wire up ranges and date ranges (elastic#52918)

* Wire up geo_bounds aggregation to ValuesSourceRegistry (elastic#53034)

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

relates elastic#42949.

* VS refactoring: convert Boxplot to new registry (elastic#53132)

* Wire-up geotile_grid and geohash_grid to ValuesSourceRegistry (elastic#53037)

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

relates to the values-source refactoring meta issue elastic#42949.

* Wire-up geo_centroid agg to ValuesSourceRegistry (elastic#53040)

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

relates to the values-source refactoring meta issue elastic#42949.

* Fix type tests for Missing aggregation (elastic#53501)

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

- 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 (elastic#53484)

* Vs refactor parser cleanup (elastic#53198)

Co-authored-by: Zachary Tong <[email protected]>
Co-authored-by: Zachary Tong <[email protected]>
Co-authored-by: Christos Soulios <[email protected]>
Co-authored-by: Tal Levy <[email protected]>
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.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (:Analytics/Aggregations)

This merges in the pipelines work and resolves related semantic conflicts

 Conflicts:
	modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/MatrixStatsAggregatorFactory.java
	modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/support/ArrayValuesSourceAggregatorFactory.java
	modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenAggregatorFactory.java
	modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/HistogramAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/AbstractRangeAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/BinaryRangeAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/GeoDistanceRangeAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/bucket/significant/SignificantTermsAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalTDigestPercentileRanks.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalTDigestPercentiles.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentileRanksAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesConfig.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregatorFactory.java
	server/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregatorFactory.java
	server/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorTests.java
	x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregatorFactory.java
	x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregatorFactory.java
	x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregatorFactory.java
@not-napoleon
Copy link
Member Author

@elasticmachine run elasticsearch-ci/1

@not-napoleon
Copy link
Member Author

@elasticmachine test this please

polyfractal and others added 7 commits April 15, 2020 14:15
 Conflicts:
	server/src/test/java/org/elasticsearch/search/aggregations/metrics/MinAggregatorTests.java
	server/src/test/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregatorTests.java
 Conflicts:
	x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/AnalyticsPlugin.java
 Conflicts:
	test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java
@not-napoleon not-napoleon merged commit 22c5518 into elastic:7.x Apr 16, 2020
@not-napoleon not-napoleon deleted the backport-vs-refactor branch April 16, 2020 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants