Module org.elasticsearch.server
Class InternalScriptedMetric
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation
org.elasticsearch.search.aggregations.metrics.InternalScriptedMetric
- All Implemented Interfaces:
NamedWriteable
,Writeable
,Aggregation
,ScriptedMetric
,ToXContent
,ToXContentFragment
-
Nested Class Summary
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.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe result of the aggregation.protected void
doWriteTo
(StreamOutput out) doXContentBody
(XContentBuilder builder, ToXContent.Params params) boolean
finalizeSampling
(SamplingContext samplingContext) Called by the parent sampling context.protected AggregatorReducer
getLeaderReducer
(AggregationReduceContext reduceContext, int size) Return an object that Reduces several aggregations to a single one.getProperty
(List<String> path) Returns the name of the writeable objectint
hashCode()
protected boolean
Signal the framework if the AggregatorReducer phase needs to be called when there is only one InternalAggregation.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.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
InternalScriptedMetric
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classInternalAggregation
- Throws:
IOException
-
getWriteableName
Description copied from interface:NamedWriteable
Returns the name of the writeable object- Specified by:
getWriteableName
in interfaceNamedWriteable
-
aggregation
Description copied from interface:ScriptedMetric
The result of the aggregation. The type of the object depends on the aggregation that was run.- Specified by:
aggregation
in interfaceScriptedMetric
-
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
-
mustReduceOnSingleInternalAgg
protected boolean mustReduceOnSingleInternalAgg()Description copied from class:InternalAggregation
Signal the framework if the AggregatorReducer phase needs to be called when there is only one InternalAggregation.- Specified by:
mustReduceOnSingleInternalAgg
in classInternalAggregation
-
getProperty
- Specified by:
getProperty
in classInternalAggregation
-
doXContentBody
public XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
doXContentBody
in classInternalAggregation
- Throws:
IOException
-
equals
- Overrides:
equals
in classInternalAggregation
-
hashCode
public int hashCode()- Overrides:
hashCode
in classInternalAggregation
-
toString
- Overrides:
toString
in classInternalAggregation
-