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
FieldsFields 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.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoWriteTo(StreamOutput out)org.elasticsearch.common.xcontent.XContentBuilderdoXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)booleaninthashCode()reduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)Reduces the given aggregations to a single one and returns it.protected InternalGeoGridBucketreduceBucket(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, getTypeMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableNameMethods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContentMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
requiredSize
protected final int requiredSize -
buckets
-
-
Constructor Details
-
InternalGeoGrid
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteToin classInternalAggregation- Throws:
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(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(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 IOException- Specified by:
doXContentBodyin classInternalAggregation- Throws:
IOException
-
hashCode
public int hashCode()- Overrides:
hashCodein classInternalAggregation
-
equals
- Overrides:
equalsin classInternalAggregation
-