Class DeprecatedIndexPredicate

java.lang.Object
org.elasticsearch.xpack.core.deprecation.DeprecatedIndexPredicate

public class DeprecatedIndexPredicate extends Object
  • Field Details

    • MINIMUM_WRITEABLE_VERSION_AFTER_UPGRADE

      public static final IndexVersion MINIMUM_WRITEABLE_VERSION_AFTER_UPGRADE
  • Constructor Details

    • DeprecatedIndexPredicate

      public DeprecatedIndexPredicate()
  • Method Details

    • getReindexRequiredPredicate

      public static Predicate<Index> getReindexRequiredPredicate(ProjectMetadata metadata, boolean filterToBlockedStatus, boolean includeSystem)
      This predicate allows through only indices that were created with a previous lucene version, meaning that they need to be reindexed in order to be writable in the _next_ lucene version. It excludes searchable snapshots as they are not writable. It ignores searchable snapshots as they are not writable.
      Parameters:
      metadata - the cluster metadata
      filterToBlockedStatus - if true, only indices that are write blocked will be returned, if false, only those without a block are returned
      includeSystem - if true, all indices including system will be returned, if false, only non-system indices are returned
      Returns:
      a predicate that returns true for indices that need to be reindexed
    • reindexRequired

      public static boolean reindexRequired(IndexMetadata indexMetadata, boolean filterToBlockedStatus, boolean includeSystem)
      This method check if the indices that were created with a previous lucene version, meaning that they need to be reindexed in order to be writable in the _next_ lucene version. It excludes searchable snapshots as they are not writable.
      Parameters:
      indexMetadata - the index metadata
      filterToBlockedStatus - if true, only indices that are write blocked will be returned, if false, only those without a block are returned
      includeSystem - if true, all indices including system will be returned, if false, only non-system indices are returned
      Returns:
      a predicate that returns true for indices that need to be reindexed