Module org.elasticsearch.xcore
Class DeprecatedIndexPredicate
java.lang.Object
org.elasticsearch.xpack.core.deprecation.DeprecatedIndexPredicate
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindInPropertiesRecursively(String type, Map<String, Object> parentMap, Function<Map<?, ?>, Boolean> predicate, BiFunction<String, Map.Entry<?, ?>, String> fieldFormatter, String fieldBeginMarker, String fieldEndMarker) iterates through the "properties" field of mappings and returns any predicates that match in the form of issue-strings.getReindexRequiredPredicate(Metadata 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.static booleanreindexRequired(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.reindexRequiredForPecolatorFields(IndexMetadata indexMetadata, boolean filterToBlockedStatus, boolean includeSystem) This method checks if this index requires reindexing based on if it has percolator fields older than the current transport version for the current minor release.static booleanreindexRequiredForTransportVersion(IndexMetadata indexMetadata, boolean filterToBlockedStatus, boolean includeSystem) This method checks if this index is on the current transport version for the current minor release version.
-
Field Details
-
MINIMUM_WRITEABLE_VERSION_AFTER_UPGRADE
-
-
Constructor Details
-
DeprecatedIndexPredicate
public DeprecatedIndexPredicate()
-
-
Method Details
-
getReindexRequiredPredicate
public static Predicate<Index> getReindexRequiredPredicate(Metadata 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 metadatafilterToBlockedStatus- if true, only indices that are write blocked will be returned, if false, only those without a block are returnedincludeSystem- 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 metadatafilterToBlockedStatus- if true, only indices that are write blocked will be returned, if false, only those without a block are returnedincludeSystem- if true, all indices including system will be returned, if false, only non-system indices are returned- Returns:
- returns true for indices that need to be reindexed
-
reindexRequiredForTransportVersion
public static boolean reindexRequiredForTransportVersion(IndexMetadata indexMetadata, boolean filterToBlockedStatus, boolean includeSystem) This method checks if this index is on the current transport version for the current minor release version.- Parameters:
indexMetadata- the index metadatafilterToBlockedStatus- if true, only indices that are write blocked will be returned, if false, only those without a block are returnedincludeSystem- if true, all indices including system will be returned, if false, only non-system indices are returned- Returns:
- returns true for indices that need to be reindexed
-
reindexRequiredForPecolatorFields
public static List<String> reindexRequiredForPecolatorFields(IndexMetadata indexMetadata, boolean filterToBlockedStatus, boolean includeSystem) This method checks if this index requires reindexing based on if it has percolator fields older than the current transport version for the current minor release.- Parameters:
indexMetadata- the index metadatafilterToBlockedStatus- if true, only indices that are write blocked will be returned, if false, only those without a block are returnedincludeSystem- if true, all indices including system will be returned, if false, only non-system indices are returned- Returns:
- returns a message as a string for each incompatible percolator field found
-
findInPropertiesRecursively
public static List<String> findInPropertiesRecursively(String type, Map<String, Object> parentMap, Function<Map<?, ?>, Boolean> predicate, BiFunction<String, Map.Entry<?, ?>, String> fieldFormatter, String fieldBeginMarker, String fieldEndMarker) iterates through the "properties" field of mappings and returns any predicates that match in the form of issue-strings.- Parameters:
type- the document typeparentMap- the mapping to read properties frompredicate- the predicate to check against for issues, issue is returned if predicate evaluates to truefieldFormatter- a function that takes a type and mapping field entry and returns a formatted field representation- Returns:
- a list of issues found in fields
-