prashantpogde commented on code in PR #4280:
URL: https://github.com/apache/ozone/pull/4280#discussion_r1119352937


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java:
##########
@@ -186,6 +206,71 @@ public static DBCheckpoint createOmSnapshotCheckpoint(
     return dbCheckpoint;
   }
 
+  /**
+   * Helper method to delete keys in the snapshot scope from active DB's
+   * deletedTable.
+   *
+   * @param omMetadataManager OMMetadataManager instance
+   * @param volumeName volume name
+   * @param bucketName bucket name
+   */
+  private static void deleteKeysInSnapshotScopeFromDTableInternal(
+      OMMetadataManager omMetadataManager,
+      String volumeName,
+      String bucketName) throws IOException {
+
+    // Range delete start key (inclusive)
+    String beginKey =
+        omMetadataManager.getOzoneKey(volumeName, bucketName, "");
+
+    // Range delete end key (exclusive) to be found
+    String endKey;
+
+    try (TableIterator<String,
+        ? extends Table.KeyValue<String, RepeatedOmKeyInfo>>
+        keyIter = omMetadataManager.getDeletedTable().iterator()) {
+
+      // TODO: Start timer for perf tracking
+      keyIter.seek(beginKey);

Review Comment:
   Shouldnt we apply the same logic to DeletedDirectoryTable ?



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java:
##########
@@ -186,6 +206,71 @@ public static DBCheckpoint createOmSnapshotCheckpoint(
     return dbCheckpoint;
   }
 
+  /**
+   * Helper method to delete keys in the snapshot scope from active DB's
+   * deletedTable.
+   *
+   * @param omMetadataManager OMMetadataManager instance
+   * @param volumeName volume name
+   * @param bucketName bucket name
+   */
+  private static void deleteKeysInSnapshotScopeFromDTableInternal(
+      OMMetadataManager omMetadataManager,
+      String volumeName,
+      String bucketName) throws IOException {
+
+    // Range delete start key (inclusive)
+    String beginKey =
+        omMetadataManager.getOzoneKey(volumeName, bucketName, "");
+
+    // Range delete end key (exclusive) to be found
+    String endKey;
+
+    try (TableIterator<String,
+        ? extends Table.KeyValue<String, RepeatedOmKeyInfo>>
+        keyIter = omMetadataManager.getDeletedTable().iterator()) {
+
+      // TODO: Start timer for perf tracking
+      keyIter.seek(beginKey);

Review Comment:
   Shouldn't we apply the same logic to DeletedDirectoryTable ?



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