Class AssociatedIndexDescriptor

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

public class AssociatedIndexDescriptor
extends java.lang.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 Summary

    Constructors
    Constructor Description
    AssociatedIndexDescriptor​(java.lang.String indexPattern, java.lang.String description)
    Create a descriptor for an index associated with a feature
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getDescription()  
    java.lang.String getIndexPattern()  
    java.util.List<java.lang.String> getMatchingIndices​(Metadata metadata)
    Retrieves a list of all indices which match this descriptor's pattern.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AssociatedIndexDescriptor

      public AssociatedIndexDescriptor​(java.lang.String indexPattern, java.lang.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 java.lang.String getIndexPattern()
      Specified by:
      getIndexPattern in interface IndexPatternMatcher
      Returns:
      The pattern of index names that this descriptor will be used for.
    • getDescription

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

      public java.util.List<java.lang.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 java.lang.String toString()
      Overrides:
      toString in class java.lang.Object