Class InternalGeoGrid<B extends InternalGeoGridBucket>
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation
org.elasticsearch.search.aggregations.InternalMultiBucketAggregation<InternalGeoGrid<B>,InternalGeoGridBucket>
org.elasticsearch.search.aggregations.bucket.geogrid.InternalGeoGrid<B>
- All Implemented Interfaces:
NamedWriteable
,Writeable
,Aggregation
,GeoGrid
,MultiBucketsAggregation
,ToXContent
,ToXContentFragment
- Direct Known Subclasses:
InternalGeoHashGrid
,InternalGeoTileGrid
public abstract class InternalGeoGrid<B extends InternalGeoGridBucket>
extends InternalMultiBucketAggregation<InternalGeoGrid<B>,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.InternalBucket
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalAggregation
InternalAggregation.ReduceContext, InternalAggregation.ReduceContextBuilder
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFields
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.bucket.geogrid.GeoGrid
GeoGrid.Bucket
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation
MultiBucketsAggregation.Bucket
Nested classes/interfaces inherited from interface org.elasticsearch.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.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doWriteTo
(StreamOutput out) doXContentBody
(XContentBuilder builder, ToXContent.Params params) boolean
int
hashCode()
reduce
(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext) Reduces the given aggregations to a single one and returns it.protected InternalGeoGridBucket
reduceBucket
(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, reducePipelines
Methods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
getMetadata, getName, getProperty, getType, isMapped, mergePipelineTreeForBWCSerialization, pipelineAggregatorsForBwcSerialization, readSize, sortValue, sortValue, 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.io.stream.NamedWriteable
getWriteableName
Methods inherited from interface org.elasticsearch.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.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:
doWriteTo
in classInternalAggregation
- Throws:
IOException
-
getBuckets
- Specified by:
getBuckets
in interfaceGeoGrid
- Specified by:
getBuckets
in interfaceMultiBucketsAggregation
- Specified by:
getBuckets
in classInternalMultiBucketAggregation<InternalGeoGrid<B extends InternalGeoGridBucket>,
InternalGeoGridBucket> - Returns:
- The buckets of this aggregation.
-
reduce
public InternalGeoGrid<B> reduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext) Description copied from class:InternalAggregation
Reduces 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:
reduce
in classInternalAggregation
- See Also:
-
reduceBucket
protected InternalGeoGridBucket reduceBucket(List<InternalGeoGridBucket> buckets, InternalAggregation.ReduceContext context) Description copied from class:InternalMultiBucketAggregation
Reduce a list of same-keyed buckets (from multiple shards) to a single bucket. This requires all buckets to have the same key.- Specified by:
reduceBucket
in classInternalMultiBucketAggregation<InternalGeoGrid<B extends InternalGeoGridBucket>,
InternalGeoGridBucket>
-
doXContentBody
public XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
doXContentBody
in classInternalAggregation
- Throws:
IOException
-
hashCode
public int hashCode()- Overrides:
hashCode
in classInternalAggregation
-
equals
- Overrides:
equals
in classInternalAggregation
-