suneet-s commented on code in PR #15770:
URL: https://github.com/apache/druid/pull/15770#discussion_r1471690385
##########
extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentKiller.java:
##########
@@ -63,6 +69,79 @@ public AzureDataSegmentKiller(
this.azureCloudBlobIterableFactory = azureCloudBlobIterableFactory;
}
+ @Override
+ public void kill(List<DataSegment> segments) throws SegmentLoadingException
+ {
+ if (segments.isEmpty()) {
+ return;
+ }
+ if (segments.size() == 1) {
+ kill(segments.get(0));
+ return;
+ }
+
+ // create a list of keys to delete
+ Map<String, List<String>> containerToKeysToDelete = new HashMap<>();
+ for (DataSegment segment : segments) {
+ Map<String, Object> loadSpec = segment.getLoadSpec();
+ final String containerName = MapUtils.getString(loadSpec,
"containerName");
+ final String blobPath = MapUtils.getString(loadSpec, "blobPath");
+ List<String> keysToDelete = containerToKeysToDelete.computeIfAbsent(
+ containerName,
+ k -> new ArrayList<>()
+ );
+ keysToDelete.add(blobPath);
+ }
+
+ boolean shouldThrowException = false;
+ for (Map.Entry<String, List<String>> containerToKeys :
containerToKeysToDelete.entrySet()) {
+ shouldThrowException = deleteBlobKeys(containerToKeys.getValue(),
containerToKeys.getKey());
Review Comment:
I believe if you do `true || evaluate_expression()` the jvm short circuits
it and chooses not to evaluate the expression since it knows true || anything
is true
--
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]