Skip to content

Commit

Permalink
Revert "Bump com.diffplug.spotless from 6.25.0 to 7.0.2 (#17058)" (#1…
Browse files Browse the repository at this point in the history
…7074)

This reverts commit 827aa63.

Signed-off-by: Andriy Redko <[email protected]>
  • Loading branch information
reta authored Jan 21, 2025
1 parent 827aa63 commit f5c89c1
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 46 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Bump `opentelemetry-semconv` from 1.27.0-alpha to 1.29.0-alpha ([#16700](https://github.com/opensearch-project/OpenSearch/pull/16700))
- Bump `com.google.re2j:re2j` from 1.7 to 1.8 ([#17012](https://github.com/opensearch-project/OpenSearch/pull/17012))
- Bump `com.squareup.okio:okio` from 3.9.1 to 3.10.2 ([#17060](https://github.com/opensearch-project/OpenSearch/pull/17060))
- Bump `com.diffplug.spotless` from 6.25.0 to 7.0.2 ([#17058](https://github.com/opensearch-project/OpenSearch/pull/17058))

### Changed
- Indexed IP field supports `terms_query` with more than 1025 IP masks [#16391](https://github.com/opensearch-project/OpenSearch/pull/16391)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ plugins {
id 'lifecycle-base'
id 'opensearch.docker-support'
id 'opensearch.global-build-info'
id "com.diffplug.spotless" version "7.0.2" apply false
id "com.diffplug.spotless" version "6.25.0" apply false
id "test-report-aggregation"
id 'jacoco-report-aggregation'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,9 @@ public void testDeleteStaleIndexRoutingPathsThrowsIOException() throws IOExcepti
doThrow(new IOException("test exception")).when(blobContainer).deleteBlobsIgnoringIfNotExists(Mockito.anyList());

remoteRoutingTableService.doStart();
IOException thrown = assertThrows(IOException.class, () -> { remoteRoutingTableService.deleteStaleIndexRoutingPaths(stalePaths); });
IOException thrown = assertThrows(IOException.class, () -> {
remoteRoutingTableService.deleteStaleIndexRoutingPaths(stalePaths);
});
assertEquals("test exception", thrown.getMessage());
verify(blobContainer).deleteBlobsIgnoringIfNotExists(stalePaths);
}
Expand All @@ -821,10 +823,9 @@ public void testDeleteStaleIndexRoutingDiffPathsThrowsIOException() throws IOExc
doThrow(new IOException("test exception")).when(blobContainer).deleteBlobsIgnoringIfNotExists(Mockito.anyList());

remoteRoutingTableService.doStart();
IOException thrown = assertThrows(
IOException.class,
() -> { remoteRoutingTableService.deleteStaleIndexRoutingDiffPaths(stalePaths); }
);
IOException thrown = assertThrows(IOException.class, () -> {
remoteRoutingTableService.deleteStaleIndexRoutingDiffPaths(stalePaths);
});
assertEquals("test exception", thrown.getMessage());
verify(blobContainer).deleteBlobsIgnoringIfNotExists(stalePaths);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,32 +104,16 @@ public void test_buildWithNoStarTreeFields() throws IOException {
public void test_getStarTreeBuilder() throws IOException {
when(mapperService.getCompositeFieldTypes()).thenReturn(Set.of(starTreeFieldType));
StarTreesBuilder starTreesBuilder = new StarTreesBuilder(segmentWriteState, mapperService, new AtomicInteger());
StarTreeBuilder starTreeBuilder = starTreesBuilder.getStarTreeBuilder(
metaOut,
dataOut,
starTreeField,
segmentWriteState,
mapperService
);
StarTreeBuilder starTreeBuilder = starTreesBuilder.getStarTreeBuilder(metaOut, dataOut, starTreeField, segmentWriteState, mapperService);
assertTrue(starTreeBuilder instanceof OnHeapStarTreeBuilder);
}

public void test_getStarTreeBuilder_illegalArgument() throws IOException {
when(mapperService.getCompositeFieldTypes()).thenReturn(Set.of(starTreeFieldType));
StarTreeFieldConfiguration starTreeFieldConfiguration = new StarTreeFieldConfiguration(
1,
new HashSet<>(),
StarTreeFieldConfiguration.StarTreeBuildMode.OFF_HEAP
);
StarTreeFieldConfiguration starTreeFieldConfiguration = new StarTreeFieldConfiguration(1, new HashSet<>(), StarTreeFieldConfiguration.StarTreeBuildMode.OFF_HEAP);
StarTreeField starTreeField = new StarTreeField("star_tree", new ArrayList<>(), new ArrayList<>(), starTreeFieldConfiguration);
StarTreesBuilder starTreesBuilder = new StarTreesBuilder(segmentWriteState, mapperService, new AtomicInteger());
StarTreeBuilder starTreeBuilder = starTreesBuilder.getStarTreeBuilder(
metaOut,
dataOut,
starTreeField,
segmentWriteState,
mapperService
);
StarTreeBuilder starTreeBuilder = starTreesBuilder.getStarTreeBuilder(metaOut, dataOut, starTreeField, segmentWriteState, mapperService);
assertTrue(starTreeBuilder instanceof OffHeapStarTreeBuilder);
starTreeBuilder.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,9 @@ public void testGetPrimaryTermGenerationUuid() {
}

public void testInitException() throws IOException {
when(
remoteMetadataDirectory.listFilesByPrefixInLexicographicOrder(
RemoteSegmentStoreDirectory.MetadataFilenameUtils.METADATA_PREFIX,
METADATA_FILES_TO_FETCH
)
).thenThrow(new IOException("Error"));
when(remoteMetadataDirectory.listFilesByPrefixInLexicographicOrder(RemoteSegmentStoreDirectory.MetadataFilenameUtils.METADATA_PREFIX, METADATA_FILES_TO_FETCH)).thenThrow(
new IOException("Error")
);

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

public void testInitMultipleMetadataFile() throws IOException {
when(
remoteMetadataDirectory.listFilesByPrefixInLexicographicOrder(
RemoteSegmentStoreDirectory.MetadataFilenameUtils.METADATA_PREFIX,
METADATA_FILES_TO_FETCH
)
).thenReturn(List.of(metadataFilename, metadataFilenameDup));
when(remoteMetadataDirectory.listFilesByPrefixInLexicographicOrder(RemoteSegmentStoreDirectory.MetadataFilenameUtils.METADATA_PREFIX, METADATA_FILES_TO_FETCH)).thenReturn(
List.of(metadataFilename, metadataFilenameDup)
);
assertThrows(IllegalStateException.class, () -> remoteSegmentStoreDirectory.init());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ public void testDeleteStaleCommitsPinnedTimestampMdFile() throws Exception {
)
).thenReturn(List.of(metadataFilename, metadataFilename2, metadataFilename3));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,8 @@ private void buildIndexShardBehavior(IndexShard mockShard, IndexShard indexShard
when(mockShard.getSegmentInfosSnapshot()).thenReturn(indexShard.getSegmentInfosSnapshot());
Store remoteStore = mock(Store.class);
when(mockShard.remoteStore()).thenReturn(remoteStore);
RemoteSegmentStoreDirectory remoteSegmentStoreDirectory =
(RemoteSegmentStoreDirectory) ((FilterDirectory) ((FilterDirectory) indexShard.remoteStore().directory()).getDelegate())
.getDelegate();
FilterDirectory remoteStoreFilterDirectory = new RemoteStoreRefreshListenerTests.TestFilterDirectory(
new RemoteStoreRefreshListenerTests.TestFilterDirectory(remoteSegmentStoreDirectory)
);
RemoteSegmentStoreDirectory remoteSegmentStoreDirectory = (RemoteSegmentStoreDirectory) ((FilterDirectory) ((FilterDirectory) indexShard.remoteStore().directory()).getDelegate()).getDelegate();
FilterDirectory remoteStoreFilterDirectory = new RemoteStoreRefreshListenerTests.TestFilterDirectory(new RemoteStoreRefreshListenerTests.TestFilterDirectory(remoteSegmentStoreDirectory));
when(remoteStore.directory()).thenReturn(remoteStoreFilterDirectory);
}
}

0 comments on commit f5c89c1

Please sign in to comment.