public abstract class InternalAggregation extends java.lang.Object implements Aggregation, NamedWriteable
Aggregation
. Serves as a base class for all aggregation implementations.Modifier and Type | Class and Description |
---|---|
static class |
InternalAggregation.ReduceContext |
Aggregation.CommonFields
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
metaData |
protected java.lang.String |
name |
TYPED_KEYS_DELIMITER
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
InternalAggregation(StreamInput in)
Read from a stream.
|
protected |
InternalAggregation(java.lang.String name,
java.util.List<PipelineAggregator> pipelineAggregators,
java.util.Map<java.lang.String,java.lang.Object> metaData)
Constructs an get with a given name.
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
doEquals(java.lang.Object obj)
Opportunity for subclasses to add criteria to the
equals(Object)
method for this class. |
protected abstract int |
doHashCode()
Opportunity for subclasses to the
hashCode() for this
class. |
abstract InternalAggregation |
doReduce(java.util.List<InternalAggregation> aggregations,
InternalAggregation.ReduceContext reduceContext) |
protected abstract void |
doWriteTo(StreamOutput out) |
abstract XContentBuilder |
doXContentBody(XContentBuilder builder,
ToXContent.Params params) |
boolean |
equals(java.lang.Object obj) |
java.util.Map<java.lang.String,java.lang.Object> |
getMetaData()
Get the optional byte array metadata that was set on the aggregation
|
java.lang.String |
getName() |
abstract java.lang.Object |
getProperty(java.util.List<java.lang.String> path) |
java.lang.Object |
getProperty(java.lang.String path)
Get the value of specified path in the aggregation.
|
java.lang.String |
getType() |
int |
hashCode() |
java.util.List<PipelineAggregator> |
pipelineAggregators() |
protected static int |
readSize(StreamInput in)
Read a size under the assumption that a value of 0 means unlimited.
|
InternalAggregation |
reduce(java.util.List<InternalAggregation> aggregations,
InternalAggregation.ReduceContext reduceContext)
Reduces the given aggregations to a single one and returns it.
|
java.lang.String |
toString() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
protected static void |
writeSize(int size,
StreamOutput out)
Write a size under the assumption that a value of 0 means unlimited.
|
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
getWriteableName
protected final java.lang.String name
protected final java.util.Map<java.lang.String,java.lang.Object> metaData
protected InternalAggregation(java.lang.String name, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)
name
- The name of the get.protected InternalAggregation(StreamInput in) throws java.io.IOException
java.io.IOException
public final void writeTo(StreamOutput out) throws java.io.IOException
Writeable
protected abstract void doWriteTo(StreamOutput out) throws java.io.IOException
java.io.IOException
public java.lang.String getName()
getName
in interface Aggregation
public final InternalAggregation reduce(java.util.List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
public abstract InternalAggregation doReduce(java.util.List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
public java.lang.Object getProperty(java.lang.String path)
path
- the path to the property in the aggregation treepublic abstract java.lang.Object getProperty(java.util.List<java.lang.String> path)
protected static int readSize(StreamInput in) throws java.io.IOException
java.io.IOException
protected static void writeSize(int size, StreamOutput out) throws java.io.IOException
java.io.IOException
public java.util.Map<java.lang.String,java.lang.Object> getMetaData()
Aggregation
getMetaData
in interface Aggregation
public java.util.List<PipelineAggregator> pipelineAggregators()
public java.lang.String getType()
getType
in interface Aggregation
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public abstract XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
java.io.IOException
public int hashCode()
hashCode
in class java.lang.Object
protected abstract int doHashCode()
hashCode()
for this
class.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
protected abstract boolean doEquals(java.lang.Object obj)
equals(Object)
method for this class.
This method can safely cast obj
to the subclass since the
equals(Object)
method checks that obj
is the same
class as this
public java.lang.String toString()
toString
in class java.lang.Object