Class SystemIndices

org.elasticsearch.indices.SystemIndices

public class SystemIndices extends
This class holds the SystemIndexDescriptor objects that represent system indices the node knows about. Methods for determining if an index should be a system index are also provided to reduce the locations within the code that need to deal with SystemIndexDescriptors.
  • Field Details

    • SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY

      public static final  SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY
      See Also:
      Constant Field Values
    • EXTERNAL_SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY

      public static final  EXTERNAL_SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY
      See Also:
      Constant Field Values
  • Constructor Details

    • SystemIndices

      public SystemIndices(<,​SystemIndices.Feature> pluginAndModulesDescriptors)
      Initialize the SystemIndices object
      Parameters:
      pluginAndModulesDescriptors - A map of this node's feature names to feature objects.
  • Method Details

    • isSystemName

      public boolean isSystemName( name)
      Checks whether the given name matches a reserved name or pattern that is intended for use by a system component. The name is checked against index names, aliases, data stream names, and the names of indices that back a system data stream.
    • isSystemIndex

      public boolean isSystemIndex(Index index)
      Determines whether a given index is a system index by comparing its name to the collection of loaded SystemIndexDescriptors
      Parameters:
      index - the Index object to check against loaded SystemIndexDescriptors
      Returns:
      true if the Index's name matches a pattern from a SystemIndexDescriptor
    • isSystemIndex

      public boolean isSystemIndex( indexName)
      Determines whether a given index is a system index by comparing its name to the collection of loaded SystemIndexDescriptors. This will also match alias names that belong to system indices.
      Parameters:
      indexName - the index name to check against loaded SystemIndexDescriptors
      Returns:
      true if the index name matches a pattern from a SystemIndexDescriptor
    • isSystemDataStream

      public boolean isSystemDataStream( name)
      Determines whether the provided name matches that of a system data stream that has been defined by a SystemDataStreamDescriptor
    • isSystemIndexBackingDataStream

      public boolean isSystemIndexBackingDataStream( name)
      Determines whether the provided name matches that of an index that backs a system data stream.
    • isNetNewSystemIndex

      public boolean isNetNewSystemIndex( indexName)
    • findMatchingDescriptor

      @Nullable public  name)
      Finds a single matching SystemIndexDescriptor, if any, for the given index name.
      Parameters:
      name - the name of the index
      Returns:
      The matching SystemIndexDescriptor or null if no descriptor is found
      Throws:
      - if multiple descriptors match the name
    • findMatchingDataStreamDescriptor

      @Nullable public  name)
      Finds a single matching SystemDataStreamDescriptor, if any, for the given DataStream name.
      Parameters:
      name - the name of the DataStream
      Returns:
      The matching SystemDataStreamDescriptor or null if no descriptor is found
      Throws:
      - if multiple descriptors match the name
    • getProductSystemIndexMetadataPredicate

      public <IndexMetadata> getProductSystemIndexMetadataPredicate(ThreadContext threadContext)
      Builds a predicate that tests if a system index should be accessible based on the provided product name contained in headers.
      Parameters:
      threadContext - the threadContext containing headers used for system index access
      Returns:
      Predicate to check external system index metadata with
    • getProductSystemIndexNamePredicate

      public <> getProductSystemIndexNamePredicate(ThreadContext threadContext)
      Builds a predicate that tests if a system index name should be accessible based on the provided product name contained in headers.
      Parameters:
      threadContext - the threadContext containing headers used for system index access
      Returns:
      Predicate to check external system index names with
    • getFeatures

      public <,​SystemIndices.Feature> getFeatures()
    • validateDataStreamAccess

      public  dataStreamName, ThreadContext threadContext)
    • dataStreamAccessException

      public  dataStreamAccessException(ThreadContext threadContext, <> names)
    • netNewSystemIndexAccessException

      public  netNewSystemIndexAccessException(ThreadContext threadContext, <> names)
    • getSystemIndexAccessLevel

      public SystemIndices.SystemIndexAccessLevel getSystemIndexAccessLevel(ThreadContext threadContext)
      Determines what level of system index access should be allowed in the current context.
      Returns:
      SystemIndices.SystemIndexAccessLevel.ALL if unrestricted system index access should be allowed, SystemIndices.SystemIndexAccessLevel.RESTRICTED if a subset of system index access should be allowed, or SystemIndices.SystemIndexAccessLevel.NONE if no system index access should be allowed.
    • validateFeatureName

      public static void validateFeatureName( name,  plugin)
      Check that a feature name is not reserved
      Parameters:
      name - Name of feature
      plugin - Name of plugin providing the feature
    • pluginToFeature

      public static SystemIndices.Feature pluginToFeature(SystemIndexPlugin plugin, Settings settings)
    • getExecutorSelector

      public ExecutorSelector getExecutorSelector()