georgew5656 commented on code in PR #15770:
URL: https://github.com/apache/druid/pull/15770#discussion_r1473207670
##########
extensions-core/azure-extensions/src/test/java/org/apache/druid/storage/azure/AzureDataSegmentKillerTest.java:
##########
@@ -285,4 +302,89 @@ private void
common_test_kill_StorageExceptionExtendedError_throwsException()
verifyAll();
}
+
+ @Test
+ public void killBatchTest() throws SegmentLoadingException,
BlobStorageException
+ {
+ Capture<List<String>> deletedFilesCapture = Capture.newInstance();
+ EasyMock.expect(azureStorage.batchDeleteFiles(
+ EasyMock.eq(CONTAINER_NAME),
+ EasyMock.capture(deletedFilesCapture),
+ EasyMock.eq(null)
+ )).andReturn(true);
+
+ replayAll();
+
+ AzureDataSegmentKiller killer = new AzureDataSegmentKiller(segmentConfig,
inputDataConfig, accountConfig, azureStorage, azureCloudBlobIterableFactory);
+
+ killer.kill(ImmutableList.of(DATA_SEGMENT, DATA_SEGMENT_2));
+
+ verifyAll();
+
+ Assert.assertEquals(
+ ImmutableSet.of(BLOB_PATH, BLOB_PATH_2),
+ new HashSet<>(deletedFilesCapture.getValue())
+ );
+ }
+
+ @Test(expected = RuntimeException.class)
Review Comment:
> I tried tracing the code to understand when azureStorage#batchDeleteFiles
can throw a runtime exception, but couldn't figure it out. Can you elaborate on
when that is possible and why we would want the data segment killer to re-throw
the runtime exception instead of wrapping it in a SegmentLoadingException. The
interface says a SegmentLoadingException should be thrown if there is an issue
with deleting the segments.
it could potentially throw a exception when trying to construct the client
(before making the requests to azure), those exceptions would not get caught
and should propagate up. it's probably not that common of a scenario though
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]