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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -858,26 +871,37 @@ private void addToObjectIdMap(Table<String, ? extends 
WithObjectID> fsTable,
                  : sstFileReader.getKeyStream()) {
       keysToCheck.forEach(key -> {
         try {
-          final WithObjectID oldKey = fsTable.get(key);
-          final WithObjectID newKey = tsTable.get(key);
+          final WithParentObjectId oldKey = fsTable.get(key);
+          final WithParentObjectId newKey = tsTable.get(key);
           if (areKeysEqual(oldKey, newKey) || !isKeyInBucket(key, 
tablePrefixes,
               fsTable.getName())) {
             // We don't have to do anything.
             return;
           }
           if (oldKey != null) {
             byte[] rawObjId = codecRegistry.asRawData(oldKey.getObjectID());
+            // Removing volume bucket info by removing the table bucket Prefix
+            // from the key.
+            // For FSO buckets will be left with the parent id/keyname.
+            // For OBS buckets will be left with the complete path
             byte[] rawValue = codecRegistry.asRawData(
-                getKeyOrDirectoryName(isDirectoryTable, oldKey));
+                key.substring(tablePrefix.length()));
             oldObjIdToKeyMap.put(rawObjId, rawValue);
             objectIDsToCheck.add(rawObjId);
+            if (oldParentIds != null) {
+              oldParentIds.add(oldKey.getParentObjectID());
+            }
+

Review Comment:
   done



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