- 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 classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionabstract DocumentDimensions
buildDocumentDimensions
(IndexSettings settings) Howtime_series_dimension
fields are handled by indices in this mode.abstract IdFieldMapper
buildIdFieldMapper
(BooleanSupplier fieldDataEnabled) Build theFieldMapper
for_id
.static IndexMode
fromString
(String value) Parse a string into anIndexMode
.abstract CompressedXContent
Get default mapping for this index ornull
if there is none.getName()
abstract TimestampBounds
getTimestampBound
(IndexMetadata indexMetadata) abstract IdFieldMapper
Get the singletonFieldMapper
for_id
.abstract boolean
abstract MetadataFieldMapper
Return an instance of theTimeSeriesIdFieldMapper
that generates the _tsid field.toString()
protected static String
tsdbMode()
abstract void
validateAlias
(String indexRouting, String searchRouting) Validate aliases targeting this index.abstract void
validateMapping
(MappingLookup lookup) Validate the mapping for this index.abstract void
validateTimestampFieldMapping
(boolean isDataStream, MappingLookup mappingLookup) validate timestamp mapping for this index.static IndexMode
Returns 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.
-
Enum Constant Details
-
STANDARD
-
TIME_SERIES
-
-
Field Details
-
DEFAULT_TIME_SERIES_TIMESTAMP_MAPPING
-
-
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 ornull
if there is none. -
buildIdFieldMapper
Build theFieldMapper
for_id
. -
idFieldMapperWithoutFieldData
Get the singletonFieldMapper
for_id
. It can never support field data. -
getTimestampBound
- Returns:
- the time range based on the provided index metadata and index mode implementation.
Otherwise
null
is returned.
-
timeSeriesIdFieldMapper
Return an instance of theTimeSeriesIdFieldMapper
that generates the _tsid field. The field mapper will be added to the list of the metadata field mappers for the index. -
buildDocumentDimensions
Howtime_series_dimension
fields 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.
-
fromString
Parse a string into anIndexMode
. -
toString
-