Package org.elasticsearch.indices
Class AssociatedIndexDescriptor
java.lang.Object
org.elasticsearch.indices.AssociatedIndexDescriptor
- All Implemented Interfaces:
IndexPatternMatcher
An "associated index" is an index that is related to or derived from a system
index, but should not be considered a system index, usually because it is
meant to be visible to users. However, if it goes out of sync with its
related system indices, it may become unreliable or useless. Hence, when
taking a snapshot of a feature, we want the associated index to be included
in the snapshot, and, likewise, we want an associated index to be restored
when a feature snapshot is restored.
-
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
-