Skip to content

Commit 759623b

Browse files
committed
SNAPSHOT - Spotless Apply
1 parent 9a3272c commit 759623b

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ static DeprecationIssue oldIndicesCheck(IndexMetadata indexMetadata, ClusterStat
3636
// TODO: this check needs to be revised. It's trivially true right now.
3737
IndexVersion currentCompatibilityVersion = indexMetadata.getCompatibilityVersion();
3838
// We intentionally exclude indices that are in data streams because they will be picked up by DataStreamDeprecationChecks
39-
if (DeprecatedIndexPredicate.reindexRequired(indexMetadata, false)
40-
&& isNotDataStreamIndex(indexMetadata, clusterState)) {
39+
if (DeprecatedIndexPredicate.reindexRequired(indexMetadata, false) && isNotDataStreamIndex(indexMetadata, clusterState)) {
4140
return new DeprecationIssue(
4241
DeprecationIssue.Level.CRITICAL,
4342
"Old index with a compatibility version < 9.0",
@@ -54,8 +53,7 @@ static DeprecationIssue ignoredOldIndicesCheck(IndexMetadata indexMetadata, Clus
5453
// TODO: this check needs to be revised. It's trivially true right now.
5554
IndexVersion currentCompatibilityVersion = indexMetadata.getCompatibilityVersion();
5655
// We intentionally exclude indices that are in data streams because they will be picked up by DataStreamDeprecationChecks
57-
if (DeprecatedIndexPredicate.reindexRequired(indexMetadata, true)
58-
&& isNotDataStreamIndex(indexMetadata, clusterState)) {
56+
if (DeprecatedIndexPredicate.reindexRequired(indexMetadata, true) && isNotDataStreamIndex(indexMetadata, clusterState)) {
5957
return new DeprecationIssue(
6058
DeprecationIssue.Level.WARNING,
6159
"Old index with a compatibility version < 9.0 Has Been Ignored",

x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,15 @@ public void testOldIndicesCheckClosedIgnored() {
136136
public void testOldIndicesIgnoredWarningCheck() {
137137
IndexVersion createdWith = IndexVersion.fromId(7170099);
138138
Settings.Builder settings = settings(createdWith).put(MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.getKey(), true);
139-
IndexMetadata indexMetadata = IndexMetadata.builder("test")
140-
.settings(settings)
141-
.numberOfShards(1)
142-
.numberOfReplicas(0)
143-
.build();
139+
IndexMetadata indexMetadata = IndexMetadata.builder("test").settings(settings).numberOfShards(1).numberOfReplicas(0).build();
144140
ClusterState clusterState = ClusterState.builder(ClusterState.EMPTY_STATE)
145141
.metadata(Metadata.builder().put(indexMetadata, true))
146142
.build();
147143
DeprecationIssue expected = new DeprecationIssue(
148144
DeprecationIssue.Level.WARNING,
149145
"Old index with a compatibility version < 9.0 Has Been Ignored",
150146
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-9.0.html",
151-
"This index has version: "
152-
+ createdWith.toReleaseVersion()
153-
+ " and has been marked as OK to become read-only after upgrade",
147+
"This index has version: " + createdWith.toReleaseVersion() + " and has been marked as OK to become read-only after upgrade",
154148
false,
155149
singletonMap("reindex_required", true)
156150
);

0 commit comments

Comments
 (0)