Skip to content

Commit 251b6d4

Browse files
authored
MultiBucketsAggregation.Bucket should not extend Writeable (#24216)
The MultiBucketsAggregation.Bucket interface extends Writeable, forcing all implementation classes to implement writeTo(). This commit removes the Writeable from the interface and move it down to the InternalBucket implementation.
1 parent c2deb1c commit 251b6d4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/src/main/java/org/elasticsearch/search/aggregations/InternalMultiBucketAggregation.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package org.elasticsearch.search.aggregations;
2121

2222
import org.elasticsearch.common.io.stream.StreamInput;
23+
import org.elasticsearch.common.io.stream.Writeable;
2324
import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation;
2425
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
2526

@@ -81,7 +82,7 @@ public Object getProperty(List<String> path) {
8182
}
8283
}
8384

84-
public abstract static class InternalBucket implements Bucket {
85+
public abstract static class InternalBucket implements Bucket, Writeable {
8586

8687
public Object getProperty(String containingAggName, List<String> path) {
8788
if (path.isEmpty()) {

core/src/main/java/org/elasticsearch/search/aggregations/bucket/MultiBucketsAggregation.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
package org.elasticsearch.search.aggregations.bucket;
2121

22-
import org.elasticsearch.common.io.stream.Writeable;
2322
import org.elasticsearch.common.util.Comparators;
2423
import org.elasticsearch.common.xcontent.ToXContent;
2524
import org.elasticsearch.search.aggregations.Aggregation;
@@ -37,7 +36,7 @@ public interface MultiBucketsAggregation extends Aggregation {
3736
* A bucket represents a criteria to which all documents that fall in it adhere to. It is also uniquely identified
3837
* by a key, and can potentially hold sub-aggregations computed over all documents in it.
3938
*/
40-
interface Bucket extends HasAggregations, ToXContent, Writeable {
39+
interface Bucket extends HasAggregations, ToXContent {
4140
/**
4241
* @return The key associated with the bucket
4342
*/

0 commit comments

Comments
 (0)