Skip to content

Commit f5c89c1

Browse files
authored
Revert "Bump com.diffplug.spotless from 6.25.0 to 7.0.2 (#17058)" (#17074)
This reverts commit 827aa63. Signed-off-by: Andriy Redko <[email protected]>
1 parent 827aa63 commit f5c89c1

File tree

7 files changed

+19
-46
lines changed

7 files changed

+19
-46
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6666
- Bump `opentelemetry-semconv` from 1.27.0-alpha to 1.29.0-alpha ([#16700](https://github.com/opensearch-project/OpenSearch/pull/16700))
6767
- Bump `com.google.re2j:re2j` from 1.7 to 1.8 ([#17012](https://github.com/opensearch-project/OpenSearch/pull/17012))
6868
- Bump `com.squareup.okio:okio` from 3.9.1 to 3.10.2 ([#17060](https://github.com/opensearch-project/OpenSearch/pull/17060))
69-
- Bump `com.diffplug.spotless` from 6.25.0 to 7.0.2 ([#17058](https://github.com/opensearch-project/OpenSearch/pull/17058))
7069

7170
### Changed
7271
- Indexed IP field supports `terms_query` with more than 1025 IP masks [#16391](https://github.com/opensearch-project/OpenSearch/pull/16391)

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ plugins {
5454
id 'lifecycle-base'
5555
id 'opensearch.docker-support'
5656
id 'opensearch.global-build-info'
57-
id "com.diffplug.spotless" version "7.0.2" apply false
57+
id "com.diffplug.spotless" version "6.25.0" apply false
5858
id "test-report-aggregation"
5959
id 'jacoco-report-aggregation'
6060
}

server/src/test/java/org/opensearch/cluster/routing/remote/RemoteRoutingTableServiceTests.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,9 @@ public void testDeleteStaleIndexRoutingPathsThrowsIOException() throws IOExcepti
800800
doThrow(new IOException("test exception")).when(blobContainer).deleteBlobsIgnoringIfNotExists(Mockito.anyList());
801801

802802
remoteRoutingTableService.doStart();
803-
IOException thrown = assertThrows(IOException.class, () -> { remoteRoutingTableService.deleteStaleIndexRoutingPaths(stalePaths); });
803+
IOException thrown = assertThrows(IOException.class, () -> {
804+
remoteRoutingTableService.deleteStaleIndexRoutingPaths(stalePaths);
805+
});
804806
assertEquals("test exception", thrown.getMessage());
805807
verify(blobContainer).deleteBlobsIgnoringIfNotExists(stalePaths);
806808
}
@@ -821,10 +823,9 @@ public void testDeleteStaleIndexRoutingDiffPathsThrowsIOException() throws IOExc
821823
doThrow(new IOException("test exception")).when(blobContainer).deleteBlobsIgnoringIfNotExists(Mockito.anyList());
822824

823825
remoteRoutingTableService.doStart();
824-
IOException thrown = assertThrows(
825-
IOException.class,
826-
() -> { remoteRoutingTableService.deleteStaleIndexRoutingDiffPaths(stalePaths); }
827-
);
826+
IOException thrown = assertThrows(IOException.class, () -> {
827+
remoteRoutingTableService.deleteStaleIndexRoutingDiffPaths(stalePaths);
828+
});
828829
assertEquals("test exception", thrown.getMessage());
829830
verify(blobContainer).deleteBlobsIgnoringIfNotExists(stalePaths);
830831
}

server/src/test/java/org/opensearch/index/compositeindex/datacube/startree/builder/StarTreesBuilderTests.java

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -104,32 +104,16 @@ public void test_buildWithNoStarTreeFields() throws IOException {
104104
public void test_getStarTreeBuilder() throws IOException {
105105
when(mapperService.getCompositeFieldTypes()).thenReturn(Set.of(starTreeFieldType));
106106
StarTreesBuilder starTreesBuilder = new StarTreesBuilder(segmentWriteState, mapperService, new AtomicInteger());
107-
StarTreeBuilder starTreeBuilder = starTreesBuilder.getStarTreeBuilder(
108-
metaOut,
109-
dataOut,
110-
starTreeField,
111-
segmentWriteState,
112-
mapperService
113-
);
107+
StarTreeBuilder starTreeBuilder = starTreesBuilder.getStarTreeBuilder(metaOut, dataOut, starTreeField, segmentWriteState, mapperService);
114108
assertTrue(starTreeBuilder instanceof OnHeapStarTreeBuilder);
115109
}
116110

117111
public void test_getStarTreeBuilder_illegalArgument() throws IOException {
118112
when(mapperService.getCompositeFieldTypes()).thenReturn(Set.of(starTreeFieldType));
119-
StarTreeFieldConfiguration starTreeFieldConfiguration = new StarTreeFieldConfiguration(
120-
1,
121-
new HashSet<>(),
122-
StarTreeFieldConfiguration.StarTreeBuildMode.OFF_HEAP
123-
);
113+
StarTreeFieldConfiguration starTreeFieldConfiguration = new StarTreeFieldConfiguration(1, new HashSet<>(), StarTreeFieldConfiguration.StarTreeBuildMode.OFF_HEAP);
124114
StarTreeField starTreeField = new StarTreeField("star_tree", new ArrayList<>(), new ArrayList<>(), starTreeFieldConfiguration);
125115
StarTreesBuilder starTreesBuilder = new StarTreesBuilder(segmentWriteState, mapperService, new AtomicInteger());
126-
StarTreeBuilder starTreeBuilder = starTreesBuilder.getStarTreeBuilder(
127-
metaOut,
128-
dataOut,
129-
starTreeField,
130-
segmentWriteState,
131-
mapperService
132-
);
116+
StarTreeBuilder starTreeBuilder = starTreesBuilder.getStarTreeBuilder(metaOut, dataOut, starTreeField, segmentWriteState, mapperService);
133117
assertTrue(starTreeBuilder instanceof OffHeapStarTreeBuilder);
134118
starTreeBuilder.close();
135119
}

server/src/test/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryTests.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,9 @@ public void testGetPrimaryTermGenerationUuid() {
135135
}
136136

137137
public void testInitException() throws IOException {
138-
when(
139-
remoteMetadataDirectory.listFilesByPrefixInLexicographicOrder(
140-
RemoteSegmentStoreDirectory.MetadataFilenameUtils.METADATA_PREFIX,
141-
METADATA_FILES_TO_FETCH
142-
)
143-
).thenThrow(new IOException("Error"));
138+
when(remoteMetadataDirectory.listFilesByPrefixInLexicographicOrder(RemoteSegmentStoreDirectory.MetadataFilenameUtils.METADATA_PREFIX, METADATA_FILES_TO_FETCH)).thenThrow(
139+
new IOException("Error")
140+
);
144141

145142
assertThrows(IOException.class, () -> remoteSegmentStoreDirectory.init());
146143
}
@@ -158,12 +155,9 @@ public void testInitNoMetadataFile() throws IOException {
158155
}
159156

160157
public void testInitMultipleMetadataFile() throws IOException {
161-
when(
162-
remoteMetadataDirectory.listFilesByPrefixInLexicographicOrder(
163-
RemoteSegmentStoreDirectory.MetadataFilenameUtils.METADATA_PREFIX,
164-
METADATA_FILES_TO_FETCH
165-
)
166-
).thenReturn(List.of(metadataFilename, metadataFilenameDup));
158+
when(remoteMetadataDirectory.listFilesByPrefixInLexicographicOrder(RemoteSegmentStoreDirectory.MetadataFilenameUtils.METADATA_PREFIX, METADATA_FILES_TO_FETCH)).thenReturn(
159+
List.of(metadataFilename, metadataFilenameDup)
160+
);
167161
assertThrows(IllegalStateException.class, () -> remoteSegmentStoreDirectory.init());
168162
}
169163

server/src/test/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryWithPinnedTimestampTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ public void testDeleteStaleCommitsPinnedTimestampMdFile() throws Exception {
187187
)
188188
).thenReturn(List.of(metadataFilename, metadataFilename2, metadataFilename3));
189189

190-
long pinnedTimestampMatchingMetadataFilename2 = RemoteSegmentStoreDirectory.MetadataFilenameUtils.getTimestamp(metadataFilename2)
191-
+ 10;
190+
long pinnedTimestampMatchingMetadataFilename2 = RemoteSegmentStoreDirectory.MetadataFilenameUtils.getTimestamp(metadataFilename2) + 10;
192191
String blobName = "snapshot1__" + pinnedTimestampMatchingMetadataFilename2;
193192
when(blobContainer.listBlobs()).thenReturn(Map.of(blobName, new PlainBlobMetadata(blobName, 100)));
194193

server/src/test/java/org/opensearch/indices/replication/RemoteStoreReplicationSourceTests.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,8 @@ private void buildIndexShardBehavior(IndexShard mockShard, IndexShard indexShard
166166
when(mockShard.getSegmentInfosSnapshot()).thenReturn(indexShard.getSegmentInfosSnapshot());
167167
Store remoteStore = mock(Store.class);
168168
when(mockShard.remoteStore()).thenReturn(remoteStore);
169-
RemoteSegmentStoreDirectory remoteSegmentStoreDirectory =
170-
(RemoteSegmentStoreDirectory) ((FilterDirectory) ((FilterDirectory) indexShard.remoteStore().directory()).getDelegate())
171-
.getDelegate();
172-
FilterDirectory remoteStoreFilterDirectory = new RemoteStoreRefreshListenerTests.TestFilterDirectory(
173-
new RemoteStoreRefreshListenerTests.TestFilterDirectory(remoteSegmentStoreDirectory)
174-
);
169+
RemoteSegmentStoreDirectory remoteSegmentStoreDirectory = (RemoteSegmentStoreDirectory) ((FilterDirectory) ((FilterDirectory) indexShard.remoteStore().directory()).getDelegate()).getDelegate();
170+
FilterDirectory remoteStoreFilterDirectory = new RemoteStoreRefreshListenerTests.TestFilterDirectory(new RemoteStoreRefreshListenerTests.TestFilterDirectory(remoteSegmentStoreDirectory));
175171
when(remoteStore.directory()).thenReturn(remoteStoreFilterDirectory);
176172
}
177173
}

0 commit comments

Comments
 (0)