java.lang.Object
org.elasticsearch.indices.AssociatedIndexDescriptor
- All Implemented Interfaces:
IndexPatternMatcher
Describes an index that is part of the state of a
SystemIndices.Feature
, but is not protected or managed by the system.
An “associated index” is often meant to be visible to users. For example, it might contain the results of a feature’s operations, which users could then query. However, if the associated index goes out of sync with the state of the feature, it may become unreliable or useless. Hence, indices matching an AssociatedIndexDescriptor will be included in snapshots of feature state, and will be restored when that feature state is restored.
The format for associated index patterns is the same mangled regex that we use in SystemIndexDescriptor. See that class’s javadoc for more details.
-
Constructor Summary
ConstructorDescriptionAssociatedIndexDescriptor
(String indexPattern, String description) Create a descriptor for an index associated with a feature -
Method Summary
Modifier and TypeMethodDescriptiongetMatchingIndices
(Metadata metadata) Retrieves a list of all indices which match this descriptor's pattern.toString()
-
Constructor Details
-
AssociatedIndexDescriptor
Create a descriptor for an index associated with a feature- Parameters:
indexPattern
- Pattern for associated indices, which can include wildcards or regex-like character classesdescription
- A short description of the purpose of this index
-
-
Method Details
-
getIndexPattern
- Specified by:
getIndexPattern
in interfaceIndexPatternMatcher
- Returns:
- The pattern of index names that this descriptor will be used for.
-
getDescription
- Returns:
- A short description of the purpose of this system index.
-
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
-
toString
-