swamirishi commented on code in PR #5158:
URL: https://github.com/apache/ozone/pull/5158#discussion_r1286520422


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java:
##########
@@ -124,6 +116,37 @@ public void start() {
 
   private class SstFilteringTask implements BackgroundTask {
 
+
+    /**
+     * Marks the SSTFiltered flag corresponding to the snapshot.
+     * @param snapshotInfoTable reference to snapshotInfo table
+     * @param volume Volume name of the snapshot
+     * @param bucket Bucket name of the snapshot
+     * @param snapshotName Snapshot name
+     * @throws IOException
+     */
+    private void markSSTFilteredFlagForSnapshot(
+        Table<String, SnapshotInfo> snapshotInfoTable, String volume,
+        String bucket, String snapshotName) throws IOException {
+      boolean acquiredSnapshotLock = 
ozoneManager.getMetadataManager().getLock()
+              .acquireWriteLock(SNAPSHOT_LOCK,
+                  volume, bucket, snapshotName);
+      try {
+        // mark the snapshot as filtered by writing to the file
+        String snapshotTableKey = SnapshotInfo.getTableKey(volume, bucket,
+            snapshotName);
+        SnapshotInfo snapshotInfo = snapshotInfoTable.get(snapshotTableKey);
+
+        snapshotInfo.setSstFiltered(true);
+        snapshotInfoTable.put(snapshotTableKey, snapshotInfo);
+      } finally {
+        if (acquiredSnapshotLock) {

Review Comment:
   yeah it would be always true, but wrote the code as per the expected 
contract of the function.



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

Reply via email to