Module org.elasticsearch.server
Class InternalGeoCentroid
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation
org.elasticsearch.search.aggregations.metrics.InternalCentroid
org.elasticsearch.search.aggregations.metrics.InternalGeoCentroid
- All Implemented Interfaces:
NamedWriteable
,Writeable
,Aggregation
,CentroidAggregation
,GeoCentroid
,ToXContent
,ToXContentFragment
Serialization and merge logic for
GeoCentroidAggregator
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.metrics.InternalCentroid
InternalCentroid.FieldExtractor
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFields
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.metrics.InternalCentroid
centroid, count
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
ConstructorDescriptionInternalGeoCentroid
(String name, SpatialPoint centroid, long count, Map<String, Object> metadata) Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected GeoPoint
protected void
protected InternalGeoCentroid
copyWith
(double firstSum, double secondSum, long totalCount) Create a new centroid with by reducing from the sums and total countprotected InternalGeoCentroid
copyWith
(SpatialPoint result, long count) static InternalGeoCentroid
protected double
extractDouble
(String name) finalizeSampling
(SamplingContext samplingContext) Called by the parent sampling context.Returns the name of the writeable objectMethods inherited from class org.elasticsearch.search.aggregations.metrics.InternalCentroid
centroid, count, doWriteTo, doXContentBody, equals, getLeaderReducer, getProperty, hashCode, mustReduceOnSingleInternalAgg, toString
Methods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
canLeadReduction, copyWithRewritenBuckets, forEachBucket, getMetadata, getName, getProperty, getReducer, getType, readSize, reducePipelines, sortValue, sortValue, 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.search.aggregations.metrics.CentroidAggregation
centroid, count
Methods inherited from interface org.elasticsearch.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
InternalGeoCentroid
public InternalGeoCentroid(String name, SpatialPoint centroid, long count, Map<String, Object> metadata) -
InternalGeoCentroid
Read from a stream.- Throws:
IOException
-
-
Method Details
-
empty
-
centroidFromStream
- Specified by:
centroidFromStream
in classInternalCentroid
- Throws:
IOException
-
centroidToStream
- Specified by:
centroidToStream
in classInternalCentroid
- Throws:
IOException
-
getWriteableName
Description copied from interface:NamedWriteable
Returns the name of the writeable object- Specified by:
getWriteableName
in interfaceNamedWriteable
-
extractDouble
- Specified by:
extractDouble
in classInternalCentroid
-
copyWith
- Specified by:
copyWith
in classInternalCentroid
-
copyWith
Description copied from class:InternalCentroid
Create a new centroid with by reducing from the sums and total count- Specified by:
copyWith
in classInternalCentroid
-
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 classInternalCentroid
- 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
-