public abstract class InternalAggregation extends java.lang.Object implements Aggregation, ToXContent, Streamable
Aggregation
. Serves as a base class for all aggregation implementations.Modifier and Type | Class and Description |
---|---|
static class |
InternalAggregation.CommonFields
Common xcontent fields that are shared among addAggregation
|
static class |
InternalAggregation.ReduceContext |
static class |
InternalAggregation.Type
The aggregation type that holds all the string types that are associated with an aggregation:
name - used as the parser type
stream - used as the stream type
|
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
metaData |
protected java.lang.String |
name |
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
InternalAggregation()
Constructs an un initialized addAggregation (used for serialization)
|
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 void |
doReadFrom(StreamInput in) |
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) |
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.util.List<PipelineAggregator> |
pipelineAggregators() |
void |
readFrom(StreamInput in)
Set this object's fields from a StreamInput.
|
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 addAggregation to a single one and returns it.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
abstract InternalAggregation.Type |
type() |
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 object's fields to a StreamOutput.
|
protected java.lang.String name
protected java.util.Map<java.lang.String,java.lang.Object> metaData
protected InternalAggregation()
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.public java.lang.String getName()
getName
in interface Aggregation
public abstract InternalAggregation.Type type()
InternalAggregation.Type
of this aggregationpublic 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)
Aggregation
getProperty
in interface Aggregation
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 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 final void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
java.io.IOException
protected abstract void doWriteTo(StreamOutput out) throws java.io.IOException
java.io.IOException
public final void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
java.io.IOException
protected abstract void doReadFrom(StreamInput in) throws java.io.IOException
java.io.IOException