Module org.elasticsearch.server
Enum Class DownsampleConfig.SamplingMethod
java.lang.Object
java.lang.Enum<DownsampleConfig.SamplingMethod>
org.elasticsearch.action.downsample.DownsampleConfig.SamplingMethod
- All Implemented Interfaces:
Serializable,Comparable<DownsampleConfig.SamplingMethod>,Constable,Writeable
- Enclosing class:
DownsampleConfig
public static enum DownsampleConfig.SamplingMethod
extends Enum<DownsampleConfig.SamplingMethod>
implements Writeable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionfromIndexMetadata(IndexMetadata indexMetadata) Retrieves the configured sampling method from the index metadata.fromString(String label) Parses the configured sampling method from string (case-insensitive).getOrDefault(DownsampleConfig.SamplingMethod samplingMethod) read(StreamInput in) toString()Returns the enum constant of this class with the specified name.static DownsampleConfig.SamplingMethod[]values()Returns an array containing the constants of this enum class, in the order they are declared.voidwriteTo(StreamOutput out) Write this into the StreamOutput.
-
Enum Constant Details
-
AGGREGATE
-
LAST_VALUE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
read
- Throws:
IOException
-
fromString
Parses the configured sampling method from string (case-insensitive).- Returns:
- the used sampling method, or null when the label is null.
-
fromIndexMetadata
@Nullable public static DownsampleConfig.SamplingMethod fromIndexMetadata(IndexMetadata indexMetadata) Retrieves the configured sampling method from the index metadata. In case that it is null, it checks if the index is downsampled and returns the `aggregate` that was the only sampling method before we introduced last value.- Returns:
- the used sampling method, or null if the index is not downsampled.
-
getOrDefault
public static DownsampleConfig.SamplingMethod getOrDefault(@Nullable DownsampleConfig.SamplingMethod samplingMethod) - Returns:
- the sampling method that will be used based on this configuration. Default to
AGGREGATEwhen the provided sampling method is null.
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toString
- Overrides:
toStringin classEnum<DownsampleConfig.SamplingMethod>
-