Skip to content

Move aggregation builders under VersionedNamedWriteable #83598

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.client.analytics;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.index.query.QueryRewriteContext;
Expand Down Expand Up @@ -121,4 +122,9 @@ public boolean equals(Object obj) {
StringStatsAggregationBuilder other = (StringStatsAggregationBuilder) obj;
return showDistribution == other.showDistribution;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.client.analytics;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.index.query.QueryRewriteContext;
Expand Down Expand Up @@ -98,4 +99,9 @@ protected AggregatorFactory doBuild(AggregationContext context, AggregatorFactor
protected AggregationBuilder shallowCopy(Builder factoriesBuilder, Map<String, Object> metadata) {
throw new UnsupportedOperationException();
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_7_7_0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.elasticsearch.search.aggregations.matrix.stats;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.search.MultiValueMode;
Expand Down Expand Up @@ -86,4 +87,9 @@ public XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params
public String getType() {
return NAME;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.elasticsearch.join.aggregations;

import org.apache.lucene.search.Query;
import org.elasticsearch.Version;
import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down Expand Up @@ -88,6 +89,7 @@ public BucketCardinality bucketCardinality() {
return BucketCardinality.ONE;
}

@Override
protected ValuesSourceAggregatorFactory innerBuild(
AggregationContext context,
ValuesSourceConfig config,
Expand Down Expand Up @@ -176,4 +178,9 @@ public String getType() {
protected ValuesSourceRegistry.RegistryKey<?> getRegistryKey() {
return ValuesSourceRegistry.UNREGISTERED_KEY;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.elasticsearch.join.aggregations;

import org.apache.lucene.search.Query;
import org.elasticsearch.Version;
import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down Expand Up @@ -175,4 +176,9 @@ public String getType() {
protected ValuesSourceRegistry.RegistryKey<?> getRegistryKey() {
return ValuesSourceRegistry.UNREGISTERED_KEY;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.ScoreMode;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse;
Expand Down Expand Up @@ -644,6 +645,11 @@ public String getType() {
public long bytesToPreallocate() {
return 0;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
package org.elasticsearch.search.aggregations;

import org.elasticsearch.Version;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.VersionedNamedWriteable;
import org.elasticsearch.index.query.QueryRewriteContext;
Expand Down Expand Up @@ -191,11 +190,6 @@ public String toString() {
return Strings.toString(this);
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}

/**
* Return true if any of the child aggregations is a time-series aggregation that requires an in-order execution
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.elasticsearch.search.aggregations.bucket.adjacency;

import org.apache.lucene.search.IndexSearcher;
import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.util.Maps;
Expand Down Expand Up @@ -253,4 +254,9 @@ public boolean equals(Object obj) {
public String getType() {
return NAME;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.search.aggregations.bucket.composite;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.index.mapper.TimeSeriesIdFieldMapper.TimeSeriesIdFieldType;
Expand Down Expand Up @@ -287,4 +288,9 @@ public boolean equals(Object obj) {
CompositeAggregationBuilder other = (CompositeAggregationBuilder) obj;
return size == other.size && Objects.equals(sources, other.sources) && Objects.equals(after, other.after);
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.search.aggregations.bucket.filter;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.index.query.QueryBuilder;
Expand Down Expand Up @@ -133,4 +134,9 @@ public String getType() {
public QueryBuilder getFilter() {
return filter;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.search.aggregations.bucket.filter;

import org.elasticsearch.Version;
import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down Expand Up @@ -361,4 +362,9 @@ public boolean equals(Object obj) {
public String getType() {
return NAME;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.search.aggregations.bucket.geogrid;

import org.elasticsearch.Version;
import org.elasticsearch.common.geo.GeoBoundingBox;
import org.elasticsearch.common.geo.GeoUtils;
import org.elasticsearch.common.io.stream.StreamInput;
Expand Down Expand Up @@ -112,4 +113,9 @@ public String getType() {
protected ValuesSourceRegistry.RegistryKey<?> getRegistryKey() {
return REGISTRY_KEY;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.search.aggregations.bucket.geogrid;

import org.elasticsearch.Version;
import org.elasticsearch.common.geo.GeoBoundingBox;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.search.aggregations.AggregationBuilder;
Expand Down Expand Up @@ -108,4 +109,9 @@ public String getType() {
protected ValuesSourceRegistry.RegistryKey<?> getRegistryKey() {
return REGISTRY_KEY;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_7_0_0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.search.aggregations.bucket.global;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
Expand Down Expand Up @@ -76,4 +77,9 @@ protected XContentBuilder internalXContent(XContentBuilder builder, Params param
public String getType() {
return NAME;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ public boolean equals(Object obj) {
return Objects.equals(numBuckets, other.numBuckets) && Objects.equals(minimumIntervalExpression, other.minimumIntervalExpression);
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}

public static class RoundingInfo implements Writeable {
final Rounding rounding;
final int[] innerIntervals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ protected void innerWriteTo(StreamOutput out) throws IOException {
*
* @param interval The calendar interval to use with the aggregation
*/
@Override
public DateHistogramAggregationBuilder calendarInterval(DateHistogramInterval interval) {
dateHistogramInterval.calendarInterval(interval);
return this;
Expand All @@ -199,6 +200,7 @@ public DateHistogramAggregationBuilder calendarInterval(DateHistogramInterval in
*
* @param interval The fixed interval to use with the aggregation
*/
@Override
public DateHistogramAggregationBuilder fixedInterval(DateHistogramInterval interval) {
dateHistogramInterval.fixedInterval(interval);
return this;
Expand Down Expand Up @@ -489,4 +491,9 @@ public boolean equals(Object obj) {
&& Objects.equals(extendedBounds, other.extendedBounds)
&& Objects.equals(hardBounds, other.hardBounds);
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -433,4 +433,9 @@ public boolean equals(Object obj) {
&& Objects.equals(extendedBounds, other.extendedBounds)
&& Objects.equals(hardBounds, other.hardBounds);
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.search.aggregations.bucket.histogram;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Settings;
Expand Down Expand Up @@ -238,4 +239,9 @@ public String getType() {
protected ValuesSourceRegistry.RegistryKey<?> getRegistryKey() {
return REGISTRY_KEY;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_7_9_0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public BucketCardinality bucketCardinality() {
return BucketCardinality.ONE;
}

@Override
protected ValuesSourceAggregatorFactory innerBuild(
AggregationContext context,
ValuesSourceConfig config,
Expand All @@ -116,4 +117,9 @@ public String getType() {
protected ValuesSourceRegistry.RegistryKey<?> getRegistryKey() {
return REGISTRY_KEY;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.search.aggregations.bucket.nested;

import org.elasticsearch.Version;
import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down Expand Up @@ -152,4 +153,9 @@ public boolean equals(Object obj) {
public String getType() {
return NAME;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.search.aggregations.bucket.nested;

import org.elasticsearch.Version;
import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down Expand Up @@ -173,4 +174,9 @@ public boolean equals(Object obj) {
public String getType() {
return NAME;
}

@Override
public Version getMinimalSupportedVersion() {
return Version.V_EMPTY;
}
}
Loading