Class InternalVariableWidthHistogram
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation
org.elasticsearch.search.aggregations.InternalMultiBucketAggregation<InternalVariableWidthHistogram,InternalVariableWidthHistogram.Bucket>
org.elasticsearch.search.aggregations.bucket.histogram.InternalVariableWidthHistogram
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment,Aggregation,Histogram,HistogramFactory,MultiBucketsAggregation
public class InternalVariableWidthHistogram
extends InternalMultiBucketAggregation<InternalVariableWidthHistogram,InternalVariableWidthHistogram.Bucket>
implements Histogram, HistogramFactory
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
InternalMultiBucketAggregation.InternalBucketNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalAggregation
InternalAggregation.ReduceContext, InternalAggregation.ReduceContextBuilderNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFieldsNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested 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, nameFields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITERFields inherited from interface org.elasticsearch.search.aggregations.bucket.histogram.Histogram
EXTENDED_BOUNDS_FIELD, HARD_BOUNDS_FIELD, INTERVAL_FIELD, KEYED_FIELD, MIN_DOC_COUNT_FIELD, OFFSET_FIELD, ORDER_FIELDFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(List<InternalVariableWidthHistogram.Bucket> buckets)Create a new copy of thisAggregationwith the same settings as thisAggregationand contains the provided buckets.Create anInternalAggregationobject that wraps the given buckets.createBucket(Number key, long docCount, InternalAggregations aggregations)Create aMultiBucketsAggregation.Bucketobject that wraps the given key, document count and aggregations.createBucket(InternalAggregations aggregations, InternalVariableWidthHistogram.Bucket prototype)Create a newInternalMultiBucketAggregation.InternalBucketusing the provided prototype bucket and aggregations.protected voiddoWriteTo(StreamOutput out)org.elasticsearch.common.xcontent.XContentBuilderdoXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)booleanorg.elasticsearch.search.aggregations.bucket.histogram.InternalVariableWidthHistogram.EmptyBucketInfogetKey(MultiBucketsAggregation.Bucket bucket)Get the key for the given bucket.intReturns the name of the writeable objectinthashCode()Given a key returned byHistogramFactory.getKey(org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation.Bucket), compute the lowest key that is greater than it.reduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)Reduces the given aggregations to a single one and returns it.protected InternalVariableWidthHistogram.BucketreduceBucket(List<InternalVariableWidthHistogram.Bucket> buckets, InternalAggregation.ReduceContext context)Reduce a list of same-keyed buckets (from multiple shards) to a single bucket.reduceBuckets(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)Methods inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
copyWithRewritenBuckets, countInnerBucket, countInnerBucket, forEachBucket, getProperty, mustReduceOnSingleInternalAgg, reducePipelinesMethods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
getMetadata, getName, getProperty, getType, isMapped, mergePipelineTreeForBWCSerialization, pipelineAggregatorsForBwcSerialization, readSize, sortValue, sortValue, toString, toXContent, writeSize, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.search.aggregations.Aggregation
getMetadata, getName, getTypeMethods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContentMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
InternalVariableWidthHistogram
Stream from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteToin classInternalAggregation- Throws:
IOException
-
getWriteableName
Description copied from interface:NamedWriteableReturns the name of the writeable object- Specified by:
getWriteableNamein interfaceNamedWriteable
-
getBuckets
- Specified by:
getBucketsin interfaceHistogram- Specified by:
getBucketsin interfaceMultiBucketsAggregation- Specified by:
getBucketsin classInternalMultiBucketAggregation<InternalVariableWidthHistogram,InternalVariableWidthHistogram.Bucket>- Returns:
- The buckets of this aggregation.
-
getTargetBuckets
public int getTargetBuckets() -
getEmptyBucketInfo
public org.elasticsearch.search.aggregations.bucket.histogram.InternalVariableWidthHistogram.EmptyBucketInfo getEmptyBucketInfo() -
create
Description copied from class:InternalMultiBucketAggregationCreate a new copy of thisAggregationwith the same settings as thisAggregationand contains the provided buckets.- Specified by:
createin classInternalMultiBucketAggregation<InternalVariableWidthHistogram,InternalVariableWidthHistogram.Bucket>- Parameters:
buckets- the buckets to use in the newAggregation- Returns:
- the new
Aggregation
-
createBucket
public InternalVariableWidthHistogram.Bucket createBucket(InternalAggregations aggregations, InternalVariableWidthHistogram.Bucket prototype)Description copied from class:InternalMultiBucketAggregationCreate a newInternalMultiBucketAggregation.InternalBucketusing the provided prototype bucket and aggregations.- Specified by:
createBucketin classInternalMultiBucketAggregation<InternalVariableWidthHistogram,InternalVariableWidthHistogram.Bucket>- Parameters:
aggregations- the aggregations for the new bucketprototype- the bucket to use as a prototype- Returns:
- the new bucket
-
createBucket
public InternalVariableWidthHistogram.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
-
getKey
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
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
-
reduceBucket
protected InternalVariableWidthHistogram.Bucket reduceBucket(List<InternalVariableWidthHistogram.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. -
reduceBuckets
public List<InternalVariableWidthHistogram.Bucket> reduceBuckets(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext) -
reduce
public InternalAggregation reduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)Description copied from class:InternalAggregationReduces the given aggregations to a single one and returns it. In most cases, the assumption will be the all given aggregations are of the same type (the same type as this aggregation). For best efficiency, when implementing, try reusing an existing instance (typically the first in the given list) to save on redundant object construction.- Specified by:
reducein classInternalAggregation- See Also:
InternalAggregation.mustReduceOnSingleInternalAgg()
-
doXContentBody
public org.elasticsearch.common.xcontent.XContentBuilder doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
doXContentBodyin classInternalAggregation- Throws:
IOException
-
createAggregation
Description copied from interface:HistogramFactoryCreate anInternalAggregationobject that wraps the given buckets.- Specified by:
createAggregationin interfaceHistogramFactory
-
equals
- Overrides:
equalsin classInternalAggregation
-
hashCode
public int hashCode()- Overrides:
hashCodein classInternalAggregation
-