Class InternalGeoGrid<B extends InternalGeoGridBucket>
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation
org.elasticsearch.search.aggregations.InternalMultiBucketAggregation<InternalGeoGrid,InternalGeoGridBucket>
org.elasticsearch.search.aggregations.bucket.geogrid.InternalGeoGrid<B>
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment,Aggregation,GeoGrid,MultiBucketsAggregation
- Direct Known Subclasses:
InternalGeoHashGrid,InternalGeoTileGrid
public abstract class InternalGeoGrid<B extends InternalGeoGridBucket> extends InternalMultiBucketAggregation<InternalGeoGrid,InternalGeoGridBucket> implements GeoGrid
Represents a grid of cells where each cell's location is determined by a specific geo hashing algorithm.
All geo-grid hash-encoding in a grid are of the same precision and held internally as a single long
for efficiency's sake.
-
Nested Class Summary
Nested 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.search.aggregations.bucket.geogrid.GeoGrid
GeoGrid.BucketNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation
MultiBucketsAggregation.BucketNested 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 Modifier and Type Field Description protected java.util.List<InternalGeoGridBucket>bucketsprotected intrequiredSizeFields inherited from class org.elasticsearch.search.aggregations.InternalAggregation
metadata, nameFields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITER -
Constructor Summary
Constructors Constructor Description InternalGeoGrid(StreamInput in)Read from a stream. -
Method Summary
Modifier and Type Method Description protected voiddoWriteTo(StreamOutput out)org.elasticsearch.common.xcontent.XContentBuilderdoXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)booleanequals(java.lang.Object obj)java.util.List<InternalGeoGridBucket>getBuckets()inthashCode()InternalGeoGridreduce(java.util.List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)Reduces the given aggregations to a single one and returns it.protected InternalGeoGridBucketreduceBucket(java.util.List<InternalGeoGridBucket> buckets, InternalAggregation.ReduceContext context)Reduce a list of same-keyed buckets (from multiple shards) to a single bucket.Methods inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
copyWithRewritenBuckets, countInnerBucket, countInnerBucket, create, createBucket, 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, getType
-
Field Details
-
requiredSize
protected final int requiredSize -
buckets
-
-
Constructor Details
-
InternalGeoGrid
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteToin classInternalAggregation- Throws:
java.io.IOException
-
getBuckets
- Specified by:
getBucketsin interfaceGeoGrid- Specified by:
getBucketsin interfaceMultiBucketsAggregation- Specified by:
getBucketsin classInternalMultiBucketAggregation<InternalGeoGrid,InternalGeoGridBucket>- Returns:
- The buckets of this aggregation.
-
reduce
public InternalGeoGrid reduce(java.util.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()
-
reduceBucket
protected InternalGeoGridBucket reduceBucket(java.util.List<InternalGeoGridBucket> 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<InternalGeoGrid,InternalGeoGridBucket>
-
doXContentBody
public org.elasticsearch.common.xcontent.XContentBuilder doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
doXContentBodyin classInternalAggregation- Throws:
java.io.IOException
-
hashCode
public int hashCode()- Overrides:
hashCodein classInternalAggregation
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classInternalAggregation
-