Class AssociatedIndexDescriptor

java.lang.Object
org.elasticsearch.indices.AssociatedIndexDescriptor
All Implemented Interfaces:
IndexPatternMatcher

public class AssociatedIndexDescriptor extends Object implements 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 Details

    • AssociatedIndexDescriptor

      public AssociatedIndexDescriptor(String indexPattern, String description)
      Create a descriptor for an index associated with a feature
      Parameters:
      indexPattern - Pattern for associated indices, which can include wildcards or regex-like character classes
      description - A short description of the purpose of this index
  • Method Details

    • getIndexPattern

      public String getIndexPattern()
      Specified by:
      getIndexPattern in interface IndexPatternMatcher
      Returns:
      The pattern of index names that this descriptor will be used for.
    • getDescription

      public String getDescription()
      Returns:
      A short description of the purpose of this system index.
    • getMatchingIndices

      public List<String> getMatchingIndices(Metadata metadata)
      Retrieves a list of all indices which match this descriptor's pattern. This cannot be done via IndexNameExpressionResolver 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 interface IndexPatternMatcher
      Parameters:
      metadata - The current metadata to get the list of matching indices from
      Returns:
      A list of index names that match this descriptor
    • toString

      public String toString()
      Overrides:
      toString in class Object