You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/03/18 08:50:51 UTC

[GitHub] [druid] clintropolis commented on a change in pull request #9523: Ability to Delete task logs and segments from Azure Storage

clintropolis commented on a change in pull request #9523: Ability to Delete task logs and segments from Azure Storage
URL: https://github.com/apache/druid/pull/9523#discussion_r394182851
 
 

 ##########
 File path: extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentKiller.java
 ##########
 @@ -72,9 +86,26 @@ public void kill(DataSegment segment) throws SegmentLoadingException
   }
 
   @Override
-  public void killAll()
+  public void killAll() throws IOException
   {
-    throw new UnsupportedOperationException("not implemented");
+    log.info("Deleting all segment files from Azure storage location [bucket: '%s' prefix: '%s']",
+             segmentConfig.getContainer(), segmentConfig.getPrefix()
+    );
+    try {
+      AzureUtils.deleteObjectsInPath(
+          azureStorage,
+          inputDataConfig,
+          accountConfig,
+          azureCloudBlobIterableFactory,
+          segmentConfig.getContainer(),
+          segmentConfig.getPrefix(),
+          Predicates.alwaysTrue()
+      );
+    }
+    catch (Exception e) {
+      log.error("Error occurred while deleting segment files from s3. Error: %s", e.getMessage());
 
 Review comment:
   Heh, should probably be
   
   ```suggestion
         log.error("Error occurred while deleting segment files from Azure. Error: %s", e.getMessage());
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org