Package org.elasticsearch.indices
Class SystemIndexDescriptor
org.elasticsearch.indices.SystemIndexDescriptor
- All Implemented Interfaces:
<SystemIndexDescriptor>
,IndexPatternMatcher
A system index descriptor describes one or more system indices. It can match a number of indices using
a pattern. For system indices that are managed externally to Elasticsearch, this is enough. For system
indices that are managed internally to Elasticsearch, a descriptor can also include information for
creating the system index, upgrading its mappings, and creating an alias.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Provides a fluent API for building aSystemIndexDescriptor
.static class
The specific type of system index that this descriptor represents. -
Constructor Summary
ConstructorDescriptionindexPattern, description)
Creates a descriptor for system indices matching the supplied pattern.indexPattern, description, SystemIndexDescriptor.Type type, <> allowedElasticProductOrigins)
Creates a descriptor for system indices matching the supplied pattern. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
int
compareTo(SystemIndexDescriptor other)
<>
getDescriptorCompatibleWith(Version version)
Finds the descriptor that can be used within this cluster, by comparing the supplied minimum node version to this descriptor's minimum version and the prior descriptors minimum version.int
<>
getMatchingIndices(Metadata metadata)
Retrieves a list of all indices which match this descriptor's pattern.cause)
Gets a standardized message when the node contains a data or master node whose version is less than that of the minimum supported version of this descriptor and its prior descriptors.boolean
boolean
boolean
boolean
boolean
isNetNew()
boolean
index)
Checks whether an index name matches the system index name pattern for this descriptor.toString()
Methods inherited from class java.lang.
, , , , , , , , ,
-
Constructor Details
-
SystemIndexDescriptor
public SystemIndexDescriptor( indexPattern, description)Creates a descriptor for system indices matching the supplied pattern. These indices will not be managed by Elasticsearch internally.- Parameters:
indexPattern
- The pattern of index names that this descriptor will be used for. Must start with a '.' character.description
- The name of the plugin responsible for this system index.
-
SystemIndexDescriptor
public SystemIndexDescriptor( indexPattern, description, SystemIndexDescriptor.Type type, <> allowedElasticProductOrigins)Creates a descriptor for system indices matching the supplied pattern. These indices will not be managed by Elasticsearch internally.- Parameters:
indexPattern
- The pattern of index names that this descriptor will be used for. Must start with a '.' character.description
- The name of the plugin responsible for this system index.type
- TheSystemIndexDescriptor.Type
of system indexallowedElasticProductOrigins
- A list of allowed origin values that should be allowed access in the case of external system indices
-
-
Method Details
-
getIndexPattern
public getIndexPattern()- Specified by:
getIndexPattern
in interfaceIndexPatternMatcher
- Returns:
- The pattern of index names that this descriptor will be used for.
-
getPrimaryIndex
public getPrimaryIndex()- Returns:
- The concrete name of an index being managed internally to Elasticsearch. Will be
null
for indices managed externally to Elasticsearch.
-
matchesIndexPattern
public boolean matchesIndexPattern( index)Checks whether an index name matches the system index name pattern for this descriptor.- Parameters:
index
- The index name to be checked against the index pattern given at construction time.- Returns:
- True if the name matches the pattern, false otherwise.
-
getMatchingIndices
Retrieves a list of all indices which match this descriptor's pattern. This cannot be done viaIndexNameExpressionResolver
because that class can only handle simple wildcard expressions, but system index name patterns may use full Lucene regular expression syntax,- Specified by:
getMatchingIndices
in interfaceIndexPatternMatcher
- Parameters:
metadata
- The current metadata to get the list of matching indices from- Returns:
- A list of index names that match this descriptor
-
getDescription
public getDescription()- Returns:
- A short description of the purpose of this system index.
-
toString
public toString()- Overrides:
in class
-
getMappings
public getMappings() -
getSettings
-
getAliasName
public getAliasName() -
getIndexFormat
public int getIndexFormat() -
getVersionMetaKey
public getVersionMetaKey() -
getMinimumNodeVersion
-
isAutomaticallyManaged
public boolean isAutomaticallyManaged() -
getOrigin
public getOrigin() -
getIndexType
public getIndexType() -
hasDynamicMappings
public boolean hasDynamicMappings() -
isExternal
public boolean isExternal() -
isInternal
public boolean isInternal() -
getAllowedElasticProductOrigins
public <> getAllowedElasticProductOrigins() -
isNetNew
public boolean isNetNew() -
getMappingVersion
-
getMinimumNodeVersionMessage
public getMinimumNodeVersionMessage( cause)Gets a standardized message when the node contains a data or master node whose version is less than that of the minimum supported version of this descriptor and its prior descriptors.- Parameters:
cause
- the action being attempted that triggered the check. Used in the error message.- Returns:
- the standardized error message
-
getDescriptorCompatibleWith
Finds the descriptor that can be used within this cluster, by comparing the supplied minimum node version to this descriptor's minimum version and the prior descriptors minimum version.- Parameters:
version
- the lower node version in the cluster- Returns:
null
if the lowest node version is lower than the minimum version in this descriptor, or the appropriate descriptor if the supplied version is acceptable.
-
getThreadPoolNames
- Returns:
- The names of thread pools that should be used for operations on this system index.
-
builder
-
compareTo
- Specified by:
in interface
<SystemIndexDescriptor>
-