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
,org.elasticsearch.xcontent.ToXContent
,org.elasticsearch.xcontent.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 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
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.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
ModifierConstructorDescriptionprotected
InternalGeoGrid
(String name, int requiredSize, List<InternalGeoGridBucket> buckets, Map<String, Object> metadata) Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract InternalGeoGrid<B>
create
(String name, int requiredSize, List<InternalGeoGridBucket> buckets, Map<String, Object> metadata) protected abstract B
createBucket
(long hashAsLong, long docCount, InternalAggregations aggregations) protected void
doWriteTo
(StreamOutput out) org.elasticsearch.xcontent.XContentBuilder
doXContentBody
(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) boolean
protected abstract Writeable.Reader<B>
int
hashCode()
reduce
(List<InternalAggregation> aggregations, AggregationReduceContext reduceContext) Reduces the given aggregations to a single one and returns it.protected InternalGeoGridBucket
reduceBucket
(List<InternalGeoGridBucket> buckets, AggregationReduceContext 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, 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
-
InternalGeoGrid
Read from a stream.- Throws:
IOException
-
-
Method Details
-
getBucketReader
-
doWriteTo
- Specified by:
doWriteTo
in classInternalAggregation
- Throws:
IOException
-
create
protected abstract InternalGeoGrid<B> create(String name, int requiredSize, List<InternalGeoGridBucket> buckets, Map<String, Object> metadata) -
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, AggregationReduceContext 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, AggregationReduceContext 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>
-
createBucket
protected abstract B createBucket(long hashAsLong, long docCount, InternalAggregations aggregations) -
doXContentBody
public org.elasticsearch.xcontent.XContentBuilder doXContentBody(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.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
-