Class InternalHistogram
- java.lang.Object
-
- org.elasticsearch.search.aggregations.InternalAggregation
-
- org.elasticsearch.search.aggregations.InternalMultiBucketAggregation<InternalHistogram,InternalHistogram.Bucket>
-
- org.elasticsearch.search.aggregations.bucket.histogram.InternalHistogram
-
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment,Aggregation,Histogram,HistogramFactory,MultiBucketsAggregation
public final class InternalHistogram extends InternalMultiBucketAggregation<InternalHistogram,InternalHistogram.Bucket> implements Histogram, HistogramFactory
Implementation ofHistogram.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInternalHistogram.Bucket-
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
InternalMultiBucketAggregation.InternalBucket
-
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalAggregation
InternalAggregation.ReduceContext
-
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFields
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.search.aggregations.InternalAggregation
metaData, name
-
Fields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITER
-
Fields inherited from interface org.elasticsearch.search.aggregations.bucket.histogram.Histogram
EXTENDED_BOUNDS_FIELD, INTERVAL_FIELD, KEYED_FIELD, MIN_DOC_COUNT_FIELD, OFFSET_FIELD, ORDER_FIELD
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description InternalHistogram(StreamInput in)Stream from a stream.
-
Method Summary
-
Methods inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
countInnerBucket, countInnerBucket, getProperty
-
Methods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
getMetaData, getName, getProperty, getType, isMapped, pipelineAggregators, readSize, reduce, toString, toXContent, writeSize, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.search.aggregations.Aggregation
getMetaData, getName, getType
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContent
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Constructor Detail
-
InternalHistogram
public InternalHistogram(StreamInput in) throws IOException
Stream from a stream.- Throws:
IOException
-
-
Method Detail
-
doWriteTo
protected void doWriteTo(StreamOutput out) throws IOException
- Specified by:
doWriteToin classInternalAggregation- Throws:
IOException
-
getWriteableName
public String getWriteableName()
Description copied from interface:NamedWriteableReturns the name of the writeable object- Specified by:
getWriteableNamein interfaceNamedWriteable
-
getBuckets
public List<InternalHistogram.Bucket> getBuckets()
- Specified by:
getBucketsin interfaceHistogram- Specified by:
getBucketsin interfaceMultiBucketsAggregation- Specified by:
getBucketsin classInternalMultiBucketAggregation<InternalHistogram,InternalHistogram.Bucket>- Returns:
- The buckets of this aggregation.
-
create
public InternalHistogram create(List<InternalHistogram.Bucket> buckets)
Description copied from class:InternalMultiBucketAggregationCreate a new copy of thisAggregationwith the same settings as thisAggregationand contains the provided buckets.- Specified by:
createin classInternalMultiBucketAggregation<InternalHistogram,InternalHistogram.Bucket>- Parameters:
buckets- the buckets to use in the newAggregation- Returns:
- the new
Aggregation
-
createBucket
public InternalHistogram.Bucket createBucket(InternalAggregations aggregations, InternalHistogram.Bucket prototype)
Description copied from class:InternalMultiBucketAggregationCreate a newInternalMultiBucketAggregation.InternalBucketusing the provided prototype bucket and aggregations.- Specified by:
createBucketin classInternalMultiBucketAggregation<InternalHistogram,InternalHistogram.Bucket>- Parameters:
aggregations- the aggregations for the new bucketprototype- the bucket to use as a prototype- Returns:
- the new bucket
-
reduceBucket
protected InternalHistogram.Bucket reduceBucket(List<InternalHistogram.Bucket> buckets, InternalAggregation.ReduceContext context)
Description copied from class:InternalMultiBucketAggregationReduce a list of same-keyed buckets (from multiple shards) to a single bucket. This requires all buckets to have the same key.- Specified by:
reduceBucketin classInternalMultiBucketAggregation<InternalHistogram,InternalHistogram.Bucket>
-
doReduce
public InternalAggregation doReduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
- Specified by:
doReducein classInternalAggregation
-
doXContentBody
public XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
doXContentBodyin classInternalAggregation- Throws:
IOException
-
getKey
public Number getKey(MultiBucketsAggregation.Bucket bucket)
Description copied from interface:HistogramFactoryGet the key for the given bucket. Date histograms must return the number of millis since Epoch of the bucket key while numeric histograms must return the double value of the key.- Specified by:
getKeyin interfaceHistogramFactory
-
nextKey
public Number nextKey(Number key)
Description copied from interface:HistogramFactoryGiven a key returned byHistogramFactory.getKey(org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation.Bucket), compute the lowest key that is greater than it.- Specified by:
nextKeyin interfaceHistogramFactory
-
createAggregation
public InternalAggregation createAggregation(List<MultiBucketsAggregation.Bucket> buckets)
Description copied from interface:HistogramFactoryCreate anInternalAggregationobject that wraps the given buckets.- Specified by:
createAggregationin interfaceHistogramFactory
-
createBucket
public InternalHistogram.Bucket createBucket(Number key, long docCount, InternalAggregations aggregations)
Description copied from interface:HistogramFactoryCreate aMultiBucketsAggregation.Bucketobject that wraps the given key, document count and aggregations.- Specified by:
createBucketin interfaceHistogramFactory
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classInternalAggregation
-
hashCode
public int hashCode()
- Overrides:
hashCodein classInternalAggregation
-
-