Module org.elasticsearch.server
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.BucketAggregationList<B extends MultiBucketsAggregation.Bucket>, 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
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
FieldsFields inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
REPORT_EMPTY_EVERY
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, EMPTY_PARAMS
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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) doXContentBody
(XContentBuilder builder, ToXContent.Params params) boolean
finalizeSampling
(SamplingContext samplingContext) Called by the parent sampling context.protected abstract Writeable.Reader<B>
protected AggregatorReducer
getLeaderReducer
(AggregationReduceContext reduceContext, int size) Return an object that Reduces several aggregations to a single one.int
hashCode()
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
canLeadReduction, getMetadata, getName, getProperty, getReducer, getType, 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.
-
getLeaderReducer
Description copied from class:InternalAggregation
Return an object that Reduces several aggregations to a single one. This method is called whenInternalAggregation.canLeadReduction()
returns true and expects an reducer that produces the right result.- Specified by:
getLeaderReducer
in classInternalAggregation
-
finalizeSampling
Description copied from class:InternalAggregation
Called by the parent sampling context. Should only ever be called once as some aggregations scale their internal values- Overrides:
finalizeSampling
in classInternalAggregation
- Parameters:
samplingContext
- the current sampling context- Returns:
- new aggregation with the sampling context applied, could be the same aggregation instance if nothing needs to be done
-
createBucket
protected abstract B createBucket(long hashAsLong, long docCount, InternalAggregations aggregations) -
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
-