Class ExponentialHistogramXContent
java.lang.Object
org.elasticsearch.exponentialhistogram.ExponentialHistogramXContent
Handles the serialization of an
ExponentialHistogram to XContent.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExponentialHistogramparseForTesting(Map<String, Object> xContent) Parses anExponentialHistogramfrom aMap.static ExponentialHistogramparseForTesting(XContentParser xContent) Parses anExponentialHistogramfrom the providedXContentParser.static voidserialize(XContentBuilder builder, ExponentialHistogram histogram) Serializes anExponentialHistogramto the providedXContentBuilder.
-
Field Details
-
SCALE_FIELD
- See Also:
-
SUM_FIELD
- See Also:
-
MIN_FIELD
- See Also:
-
MAX_FIELD
- See Also:
-
ZERO_FIELD
- See Also:
-
ZERO_COUNT_FIELD
- See Also:
-
ZERO_THRESHOLD_FIELD
- See Also:
-
POSITIVE_FIELD
- See Also:
-
NEGATIVE_FIELD
- See Also:
-
BUCKET_INDICES_FIELD
- See Also:
-
BUCKET_COUNTS_FIELD
- See Also:
-
-
Constructor Details
-
ExponentialHistogramXContent
public ExponentialHistogramXContent()
-
-
Method Details
-
serialize
public static void serialize(XContentBuilder builder, @Nullable ExponentialHistogram histogram) throws IOException Serializes anExponentialHistogramto the providedXContentBuilder.- Parameters:
builder- the XContentBuilder to write tohistogram- the ExponentialHistogram to serialize- Throws:
IOException- if the XContentBuilder throws an IOException
-
parseForTesting
Parses anExponentialHistogramfrom the providedXContentParser. This method is neither optimized, nor does it do any validation of the parsed content. No estimation for missing sum/min/max is done. Therefore only intended for testing!- Parameters:
xContent- the serialized histogram to read- Returns:
- the deserialized histogram
- Throws:
IOException- if the XContentParser throws an IOException
-
parseForTesting
Parses anExponentialHistogramfrom aMap. This method is neither optimized, nor does it do any validation of the parsed content. No estimation for missing sum/min/max is done. Therefore only intended for testing!- Parameters:
xContent- the serialized histogram as a map- Returns:
- the deserialized histogram
-