- All Implemented Interfaces:
Serializable,Comparable<IndexMode>,Constable
"Mode" that controls which behaviors and settings an index supports.
For the most part this class concentrates on validating settings and mappings. Most different behavior is controlled by forcing settings to be set or not set and by enabling extra fields in the mapping.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA built-in index setting provider that supplies additional index settings based on the index mode.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionabstract IdFieldMapperbuildIdFieldMapper(BooleanSupplier fieldDataEnabled) Build theFieldMapperfor_id.abstract RoutingFieldsbuildRoutingFields(IndexSettings settings) Howtime_series_dimensionfields are handled by indices in this mode.abstract SourceFieldMapper.Modestatic IndexModefromString(String value) Parse a string into anIndexMode.abstract CompressedXContentgetDefaultMapping(IndexSettings indexSettings) Get default mapping for this index ornullif there is none.getName()abstract TimestampBoundsgetTimestampBound(IndexMetadata indexMetadata) abstract IdFieldMapperGet the singletonFieldMapperfor_id.static IndexModereadFrom(StreamInput in) abstract booleanabstract MetadataFieldMapperReturn an instance of theTimeSeriesIdFieldMapperthat generates the _tsid field.abstract MetadataFieldMapperReturn an instance of theTimeSeriesRoutingHashFieldMapperthat generates the _ts_routing_hash field.toString()protected static StringtsdbMode()abstract voidvalidateAlias(String indexRouting, String searchRouting) Validate aliases targeting this index.abstract voidvalidateMapping(MappingLookup lookup) Validate the mapping for this index.abstract voidvalidateSourceFieldMapper(SourceFieldMapper sourceFieldMapper) Validates the source field mapperabstract voidvalidateTimestampFieldMapping(boolean isDataStream, MappingLookup mappingLookup) validate timestamp mapping for this index.static IndexModeReturns the enum constant of this class with the specified name.static IndexMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.static voidwriteTo(IndexMode indexMode, StreamOutput out)
-
Enum Constant Details
-
STANDARD
-
TIME_SERIES
-
LOGSDB
-
LOOKUP
-
-
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
-
tsdbMode
-
getName
-
validateMapping
Validate the mapping for this index. -
validateAlias
Validate aliases targeting this index. -
validateTimestampFieldMapping
public abstract void validateTimestampFieldMapping(boolean isDataStream, MappingLookup mappingLookup) throws IOException validate timestamp mapping for this index.- Throws:
IOException
-
getDefaultMapping
Get default mapping for this index ornullif there is none. -
buildIdFieldMapper
Build theFieldMapperfor_id. -
idFieldMapperWithoutFieldData
Get the singletonFieldMapperfor_id. It can never support field data. -
getTimestampBound
- Returns:
- the time range based on the provided index metadata and index mode implementation.
Otherwise
nullis returned.
-
timeSeriesIdFieldMapper
Return an instance of theTimeSeriesIdFieldMapperthat generates the _tsid field. The field mapper will be added to the list of the metadata field mappers for the index. -
timeSeriesRoutingHashFieldMapper
Return an instance of theTimeSeriesRoutingHashFieldMapperthat generates the _ts_routing_hash field. The field mapper will be added to the list of the metadata field mappers for the index. -
buildRoutingFields
Howtime_series_dimensionfields are handled by indices in this mode. -
shouldValidateTimestamp
public abstract boolean shouldValidateTimestamp()- Returns:
- Whether timestamps should be validated for being withing the time range of an index.
-
validateSourceFieldMapper
Validates the source field mapper -
defaultSourceMode
- Returns:
- default source mode for this mode
-
getDefaultCodec
-
fromString
Parse a string into anIndexMode. -
readFrom
- Throws:
IOException
-
writeTo
- Throws:
IOException
-
toString
-