public abstract class InternalAggregation extends 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 Map<String,Object> |
metaData |
protected String |
name |
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
InternalAggregation()
Constructs an un initialized addAggregation (used for serialization)
|
protected |
InternalAggregation(String name,
List<PipelineAggregator> pipelineAggregators,
Map<String,Object> metaData)
Constructs an get with a given name.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doReadFrom(StreamInput in) |
abstract InternalAggregation |
doReduce(List<InternalAggregation> aggregations,
InternalAggregation.ReduceContext reduceContext) |
protected abstract void |
doWriteTo(StreamOutput out) |
abstract XContentBuilder |
doXContentBody(XContentBuilder builder,
ToXContent.Params params) |
Map<String,Object> |
getMetaData()
Get the optional byte array metadata that was set on the aggregation
|
String |
getName() |
abstract Object |
getProperty(List<String> path) |
Object |
getProperty(String path)
Get the value of specified path in the aggregation.
|
List<PipelineAggregator> |
pipelineAggregators() |
void |
readFrom(StreamInput in) |
protected static int |
readSize(StreamInput in)
Read a size under the assumption that a value of 0 means unlimited.
|
InternalAggregation |
reduce(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) |
protected InternalAggregation()
public String getName()
getName
in interface Aggregation
public abstract InternalAggregation.Type type()
InternalAggregation.Type
of this aggregationpublic final InternalAggregation reduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
public abstract InternalAggregation doReduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
public Object getProperty(String path)
Aggregation
getProperty
in interface Aggregation
path
- the path to the property in the aggregation treeprotected static int readSize(StreamInput in) throws IOException
IOException
protected static void writeSize(int size, StreamOutput out) throws IOException
IOException
public Map<String,Object> getMetaData()
Aggregation
getMetaData
in interface Aggregation
public List<PipelineAggregator> pipelineAggregators()
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent
in interface ToXContent
IOException
public abstract XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws IOException
IOException
public final void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
IOException
protected abstract void doWriteTo(StreamOutput out) throws IOException
IOException
public final void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
IOException
protected abstract void doReadFrom(StreamInput in) throws IOException
IOException
Copyright © 2009–2016. All rights reserved.