Class AssociatedIndexDescriptor

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

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