- 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 DocumentDimensionsbuildDocumentDimensions(IndexSettings settings) Howtime_series_dimensionfields are handled by indices in this mode.abstract IdFieldMapperbuildIdFieldMapper(BooleanSupplier fieldDataEnabled) Build theFieldMapperfor_id.static IndexModefromString(String value) Parse a string into anIndexMode.abstract CompressedXContentGet default mapping for this index ornullif there is none.getName()abstract TimestampBoundsgetTimestampBound(IndexMetadata indexMetadata) abstract IdFieldMapperGet the singletonFieldMapperfor_id.abstract booleanabstract 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.
-
Enum Constant Details
-
STANDARD
-
TIME_SERIES
-
LOGSDB
-
-
Field Details
-
DEFAULT_TIME_SERIES_TIMESTAMP_MAPPING
-
DEFAULT_LOGS_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 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. -
buildDocumentDimensions
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 -
isSyntheticSourceEnabled
public abstract boolean isSyntheticSourceEnabled()- Returns:
- whether synthetic source is the only allowed source mode.
-
fromString
Parse a string into anIndexMode. -
toString
-