Class InternalAutoDateHistogram
- java.lang.Object
-
- org.elasticsearch.search.aggregations.InternalAggregation
-
- org.elasticsearch.search.aggregations.InternalMultiBucketAggregation<InternalAutoDateHistogram,InternalAutoDateHistogram.Bucket>
-
- org.elasticsearch.search.aggregations.bucket.histogram.InternalAutoDateHistogram
-
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment,Aggregation,Histogram,HistogramFactory,MultiBucketsAggregation
public final class InternalAutoDateHistogram extends InternalMultiBucketAggregation<InternalAutoDateHistogram,InternalAutoDateHistogram.Bucket> implements Histogram, HistogramFactory
Implementation ofHistogram.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInternalAutoDateHistogram.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 InternalAutoDateHistogram(StreamInput in)Stream from a stream.
-
Method Summary
Modifier and Type Method Description InternalAutoDateHistogramcreate(java.util.List<InternalAutoDateHistogram.Bucket> buckets)Create a new copy of thisAggregationwith the same settings as thisAggregationand contains the provided buckets.InternalAggregationcreateAggregation(java.util.List<MultiBucketsAggregation.Bucket> buckets)Create anInternalAggregationobject that wraps the given buckets.InternalAutoDateHistogram.BucketcreateBucket(java.lang.Number key, long docCount, InternalAggregations aggregations)Create aMultiBucketsAggregation.Bucketobject that wraps the given key, document count and aggregations.InternalAutoDateHistogram.BucketcreateBucket(InternalAggregations aggregations, InternalAutoDateHistogram.Bucket prototype)Create a newInternalMultiBucketAggregation.InternalBucketusing the provided prototype bucket and aggregations.InternalAggregationdoReduce(java.util.List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)protected voiddoWriteTo(StreamOutput out)XContentBuilderdoXContentBody(XContentBuilder builder, ToXContent.Params params)booleanequals(java.lang.Object obj)org.elasticsearch.search.aggregations.bucket.histogram.InternalAutoDateHistogram.BucketInfogetBucketInfo()java.util.List<InternalAutoDateHistogram.Bucket>getBuckets()DateHistogramIntervalgetInterval()java.lang.NumbergetKey(MultiBucketsAggregation.Bucket bucket)Get the key for the given bucket.intgetTargetBuckets()java.lang.StringgetWriteableName()Returns the name of the writeable objectinthashCode()java.lang.NumbernextKey(java.lang.Number key)Given a key returned byHistogramFactory.getKey(org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation.Bucket), compute the lowest key that is greater than it.-
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
-
InternalAutoDateHistogram
public InternalAutoDateHistogram(StreamInput in) throws java.io.IOException
Stream from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
doWriteTo
protected void doWriteTo(StreamOutput out) throws java.io.IOException
- Specified by:
doWriteToin classInternalAggregation- Throws:
java.io.IOException
-
getInterval
public DateHistogramInterval getInterval()
-
getWriteableName
public java.lang.String getWriteableName()
Description copied from interface:NamedWriteableReturns the name of the writeable object- Specified by:
getWriteableNamein interfaceNamedWriteable
-
getBuckets
public java.util.List<InternalAutoDateHistogram.Bucket> getBuckets()
- Specified by:
getBucketsin interfaceHistogram- Specified by:
getBucketsin interfaceMultiBucketsAggregation- Specified by:
getBucketsin classInternalMultiBucketAggregation<InternalAutoDateHistogram,InternalAutoDateHistogram.Bucket>- Returns:
- The buckets of this aggregation.
-
getTargetBuckets
public int getTargetBuckets()
-
getBucketInfo
public org.elasticsearch.search.aggregations.bucket.histogram.InternalAutoDateHistogram.BucketInfo getBucketInfo()
-
create
public InternalAutoDateHistogram create(java.util.List<InternalAutoDateHistogram.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<InternalAutoDateHistogram,InternalAutoDateHistogram.Bucket>- Parameters:
buckets- the buckets to use in the newAggregation- Returns:
- the new
Aggregation
-
createBucket
public InternalAutoDateHistogram.Bucket createBucket(InternalAggregations aggregations, InternalAutoDateHistogram.Bucket prototype)
Description copied from class:InternalMultiBucketAggregationCreate a newInternalMultiBucketAggregation.InternalBucketusing the provided prototype bucket and aggregations.- Specified by:
createBucketin classInternalMultiBucketAggregation<InternalAutoDateHistogram,InternalAutoDateHistogram.Bucket>- Parameters:
aggregations- the aggregations for the new bucketprototype- the bucket to use as a prototype- Returns:
- the new bucket
-
doReduce
public InternalAggregation doReduce(java.util.List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
- Specified by:
doReducein classInternalAggregation
-
doXContentBody
public XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
doXContentBodyin classInternalAggregation- Throws:
java.io.IOException
-
getKey
public java.lang.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 java.lang.Number nextKey(java.lang.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(java.util.List<MultiBucketsAggregation.Bucket> buckets)
Description copied from interface:HistogramFactoryCreate anInternalAggregationobject that wraps the given buckets.- Specified by:
createAggregationin interfaceHistogramFactory
-
createBucket
public InternalAutoDateHistogram.Bucket createBucket(java.lang.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(java.lang.Object obj)
- Overrides:
equalsin classInternalAggregation
-
hashCode
public int hashCode()
- Overrides:
hashCodein classInternalAggregation
-
-