Skip to content

Commit d31a210

Browse files
committed
SNAPSHOT - Spotless Apply
1 parent 2c26069 commit d31a210

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
@@ -37,8 +37,7 @@ static DeprecationIssue oldIndicesCheck(IndexMetadata indexMetadata, ClusterStat
3737
// TODO: this check needs to be revised. It's trivially true right now.
3838
IndexVersion currentCompatibilityVersion = indexMetadata.getCompatibilityVersion();
3939
// We intentionally exclude indices that are in data streams because they will be picked up by DataStreamDeprecationChecks
40-
if (DeprecatedIndexPredicate.reindexRequired(indexMetadata, false)
41-
&& isNotDataStreamIndex(indexMetadata, clusterState)) {
40+
if (DeprecatedIndexPredicate.reindexRequired(indexMetadata, false) && isNotDataStreamIndex(indexMetadata, clusterState)) {
4241
return new DeprecationIssue(
4342
DeprecationIssue.Level.CRITICAL,
4443
"Old index with a compatibility version < 9.0",
@@ -55,8 +54,7 @@ static DeprecationIssue ignoredOldIndicesCheck(IndexMetadata indexMetadata, Clus
5554
// TODO: this check needs to be revised. It's trivially true right now.
5655
IndexVersion currentCompatibilityVersion = indexMetadata.getCompatibilityVersion();
5756
// We intentionally exclude indices that are in data streams because they will be picked up by DataStreamDeprecationChecks
58-
if (DeprecatedIndexPredicate.reindexRequired(indexMetadata, true)
59-
&& isNotDataStreamIndex(indexMetadata, clusterState)) {
57+
if (DeprecatedIndexPredicate.reindexRequired(indexMetadata, true) && isNotDataStreamIndex(indexMetadata, clusterState)) {
6058
return new DeprecationIssue(
6159
DeprecationIssue.Level.WARNING,
6260
"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
@@ -120,21 +120,15 @@ public void testOldIndicesCheckSnapshotIgnored() {
120120
public void testOldIndicesIgnoredWarningCheck() {
121121
IndexVersion createdWith = IndexVersion.fromId(7170099);
122122
Settings.Builder settings = settings(createdWith).put(MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.getKey(), true);
123-
IndexMetadata indexMetadata = IndexMetadata.builder("test")
124-
.settings(settings)
125-
.numberOfShards(1)
126-
.numberOfReplicas(0)
127-
.build();
123+
IndexMetadata indexMetadata = IndexMetadata.builder("test").settings(settings).numberOfShards(1).numberOfReplicas(0).build();
128124
ClusterState clusterState = ClusterState.builder(ClusterState.EMPTY_STATE)
129125
.metadata(Metadata.builder().put(indexMetadata, true))
130126
.build();
131127
DeprecationIssue expected = new DeprecationIssue(
132128
DeprecationIssue.Level.WARNING,
133129
"Old index with a compatibility version < 9.0 Has Been Ignored",
134130
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-9.0.html",
135-
"This index has version: "
136-
+ createdWith.toReleaseVersion()
137-
+ " and has been marked as OK to become read-only after upgrade",
131+
"This index has version: " + createdWith.toReleaseVersion() + " and has been marked as OK to become read-only after upgrade",
138132
false,
139133
singletonMap("reindex_required", true)
140134
);

0 commit comments

Comments
 (0)