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.Fields, InternalCentroid.ShapeDataNested 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, count, shapeDataFields 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) InternalGeoCentroid(String name, SpatialPoint centroid, long count, InternalCentroid.ShapeData shapeData, Map<String, Object> metadata) Constructor for shape centroid results that carry raw weighted sums for correct cross-shard reduction.Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected GeoPointprotected voidprotected InternalGeoCentroidcopyWith(double firstSum, double secondSum, long totalCount) Create a new centroid by reducing from the sums and total count (count-weighted path for geo_point).protected InternalGeoCentroidcopyWith(SpatialPoint result, long count) protected InternalGeoCentroidcopyWithShapeFields(InternalCentroid.ShapeData shapeData, long count) Create a new centroid from shape-aware weighted sums (area-weighted path for geo_shape).static InternalGeoCentroidprotected doubleextractDouble(String name) protected doubleextractFirst(SpatialPoint point) protected doubleextractSecond(SpatialPoint point) Returns the name of the writeable objectprotected Stringprotected StringMethods inherited from class org.elasticsearch.search.aggregations.metrics.InternalCentroid
centroid, count, doWriteTo, doXContentBody, equals, finalizeSampling, 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
public InternalGeoCentroid(String name, SpatialPoint centroid, long count, InternalCentroid.ShapeData shapeData, Map<String, Object> metadata) Constructor for shape centroid results that carry raw weighted sums for correct cross-shard reduction. -
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 by reducing from the sums and total count (count-weighted path for geo_point).- Specified by:
copyWithin classInternalCentroid
-
copyWithShapeFields
Description copied from class:InternalCentroidCreate a new centroid from shape-aware weighted sums (area-weighted path for geo_shape).- Specified by:
copyWithShapeFieldsin classInternalCentroid
-
nameFirst
- Specified by:
nameFirstin classInternalCentroid
-
extractFirst
- Specified by:
extractFirstin classInternalCentroid
-
nameSecond
- Specified by:
nameSecondin classInternalCentroid
-
extractSecond
- Specified by:
extractSecondin classInternalCentroid
-