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.FieldsNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFieldsNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested 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, countFields 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.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionInternalGeoCentroid(String name, SpatialPoint centroid, long count, Map<String, Object> metadata) Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected GeoPointprotected voidprotected InternalGeoCentroidcopyWith(double firstSum, double secondSum, long totalCount) Create a new centroid with by reducing from the sums and total countprotected InternalGeoCentroidcopyWith(SpatialPoint result, long count) static InternalGeoCentroidprotected doubleextractDouble(String name) protected doubleextractFirst(SpatialPoint point) protected doubleextractSecond(SpatialPoint point) finalizeSampling(SamplingContext samplingContext) Called by the parent sampling context.Returns the name of the writeable objectprotected Stringprotected StringMethods inherited from class org.elasticsearch.search.aggregations.metrics.InternalCentroid
centroid, count, doWriteTo, doXContentBody, equals, getLeaderReducer, getProperty, hashCode, mustReduceOnSingleInternalAgg, toStringMethods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
canLeadReduction, copyWithRewritenBuckets, forEachBucket, getMetadata, getName, getProperty, getReducer, getType, readSize, reducePipelines, sortValue, sortValue, 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.search.aggregations.metrics.CentroidAggregation
centroid, countMethods inherited from interface org.elasticsearch.xcontent.ToXContent
toXContentMethods 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:
centroidFromStreamin classInternalCentroid- Throws:
IOException
-
centroidToStream
- Specified by:
centroidToStreamin classInternalCentroid- Throws:
IOException
-
getWriteableName
Description copied from interface:NamedWriteableReturns the name of the writeable object- Specified by:
getWriteableNamein interfaceNamedWriteable
-
extractDouble
- Specified by:
extractDoublein classInternalCentroid
-
copyWith
- Specified by:
copyWithin classInternalCentroid
-
copyWith
Description copied from class:InternalCentroidCreate a new centroid with by reducing from the sums and total count- Specified by:
copyWithin classInternalCentroid
-
nameFirst
- Specified by:
nameFirstin classInternalCentroid
-
extractFirst
- Specified by:
extractFirstin classInternalCentroid
-
nameSecond
- Specified by:
nameSecondin classInternalCentroid
-
extractSecond
- Specified by:
extractSecondin classInternalCentroid
-
finalizeSampling
Description copied from class:InternalAggregationCalled by the parent sampling context. Should only ever be called once as some aggregations scale their internal values- Overrides:
finalizeSamplingin 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
-