shekhars-li commented on code in PR #1676:
URL: https://github.com/apache/samza/pull/1676#discussion_r1287896727


##########
samza-core/src/main/java/org/apache/samza/storage/blobstore/util/BlobStoreUtil.java:
##########
@@ -210,6 +216,56 @@ public CompletableFuture<String> 
putSnapshotIndex(SnapshotIndex snapshotIndex) {
     }, isCauseNonRetriable(), executor, retryPolicyConfig);
   }
 
+  /**
+   * Cleans up a SnapshotIndex by recursively deleting all blobs associated 
with files/subdirs inside the SnapshotIndex
+   * and finally deletes SnapshotIndex blob itself. This is done by getting 
the SnapshotIndex first.
+   * @param snapshotIndexBlobId Blob if of SnapshotIndex
+   * @param requestMetadata Metadata of the request
+   */
+  public CompletionStage<Void> cleanSnapshotIndex(String snapshotIndexBlobId, 
Metadata requestMetadata) {
+    return cleanSnapshotIndex(snapshotIndexBlobId, requestMetadata, false);
+  }
+
+  /**
+   * Cleans up a SnapshotIndex by recursively deleting all blobs associated 
with files/subdirs inside the SnapshotIndex
+   * and finally deletes SnapshotIndex blob itself. This is done by getting 
the SnapshotIndex first.
+   * @param snapshotIndexBlobId Blob if of SnapshotIndex
+   * @param requestMetadata Metadata of the request
+   * @param getDeletedBlob Gets SnapshotIndex with getDeleted flag set
+   */
+  public CompletionStage<Void> cleanSnapshotIndex(String snapshotIndexBlobId, 
Metadata requestMetadata, Boolean getDeletedBlob) {
+    Metadata getSnapshotRequest = new 
Metadata(Metadata.SNAPSHOT_INDEX_PAYLOAD_PATH, Optional.empty(), 
requestMetadata.getJobName(),
+        requestMetadata.getJobId(), requestMetadata.getTaskName(), 
requestMetadata.getStoreName());
+    SnapshotIndex snapshotIndex = getSnapshotIndex(snapshotIndexBlobId, 
getSnapshotRequest, getDeletedBlob).join();

Review Comment:
   That was left over from a test. Removed it. Thanks for catching this. Updated



-- 
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]

Reply via email to