zhangyue19921010 commented on a change in pull request #10956:
URL: https://github.com/apache/druid/pull/10956#discussion_r592080378
##########
File path:
server/src/test/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinatorTest.java
##########
@@ -848,6 +848,28 @@ public void testDeleteDataSourceMetadata() throws
IOException
Assert.assertNull("getDataSourceMetadataNullAfterDelete",
coordinator.retrieveDataSourceMetadata("fooDataSource"));
}
+ @Test
+ public void testDeleteSegments()
+ {
+ Exception e = null;
+ try {
+ coordinator.deleteSegments(SEGMENTS);
+ }
+ catch (Exception ex) {
+ e = ex;
+ }
+ Assert.assertNull(e);
+ Assert.assertEquals(
+ 0,
+ ImmutableSet.copyOf(
+ coordinator.retrieveUnusedSegmentsForInterval(
+ defaultSegment.getDataSource(),
+ defaultSegment.getInterval()
+ )
+ ).size()
+ );
+ }
Review comment:
Sure, I did a little change. What I want to test is the function of
deleting segment metadata in MetaDataStorage.
Here is the workflow of this UT: `Published segments to MetaDataStorage` ->
`check segments Published` -> `remove segments in MetaDataStorage` -> `check
segments removed`.
Also name have been changed as `testDeleteSegmentsInMetaDataStorage`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]