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.
This commit is contained in:
Tanguy Leroux 2017-04-21 15:29:53 +02:00 committed by GitHub
parent c2deb1c81d
commit 251b6d452b
2 changed files with 3 additions and 3 deletions

View File

@ -20,6 +20,7 @@
package org.elasticsearch.search.aggregations;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation;
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
@ -81,7 +82,7 @@ public abstract class InternalMultiBucketAggregation<A extends InternalMultiBuck
}
}
public abstract static class InternalBucket implements Bucket {
public abstract static class InternalBucket implements Bucket, Writeable {
public Object getProperty(String containingAggName, List<String> path) {
if (path.isEmpty()) {

View File

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