swamirishi commented on code in PR #7200:
URL: https://github.com/apache/ozone/pull/7200#discussion_r1765676948
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotUtils.java:
##########
@@ -242,4 +242,43 @@ public static String
getOzonePathKeyForFso(OMMetadataManager metadataManager,
final long bucketId = metadataManager.getBucketId(volumeName, bucketName);
return OM_KEY_PREFIX + volumeId + OM_KEY_PREFIX + bucketId + OM_KEY_PREFIX;
}
+
+ /**
+ * Creates merged repeatedKeyInfo entry with the existing deleted entry in
the table.
Review Comment:
done
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotUtils.java:
##########
@@ -242,4 +242,43 @@ public static String
getOzonePathKeyForFso(OMMetadataManager metadataManager,
final long bucketId = metadataManager.getBucketId(volumeName, bucketName);
return OM_KEY_PREFIX + volumeId + OM_KEY_PREFIX + bucketId + OM_KEY_PREFIX;
}
+
+ /**
+ * Creates merged repeatedKeyInfo entry with the existing deleted entry in
the table.
+ * @param snapshotMoveKeyInfos keyInfos to be added.
+ * @param metadataManager metadataManager for a store.
+ * @return
+ * @throws IOException
+ */
+ public static RepeatedOmKeyInfo
createMergedRepeatedOmKeyInfoFromDeletedTableEntry(
+ OzoneManagerProtocolProtos.SnapshotMoveKeyInfos snapshotMoveKeyInfos,
OMMetadataManager metadataManager) throws
+ IOException {
+ String dbKey = snapshotMoveKeyInfos.getKey();
+ List<OmKeyInfo> keyInfoList = new ArrayList<>();
+ for (OzoneManagerProtocolProtos.KeyInfo info :
snapshotMoveKeyInfos.getKeyInfosList()) {
+ OmKeyInfo fromProtobuf = OmKeyInfo.getFromProtobuf(info);
+ keyInfoList.add(fromProtobuf);
+ }
+ // When older version of keys are moved to the next snapshot's deletedTable
+ // The newer version might also be in the next snapshot's deletedTable and
+ // it might overwrite. This is to avoid that and also avoid having
+ // orphans blocks. Checking the last keyInfoList size omKeyInfo versions,
+ // this is to avoid redundant additions if the last n versions match.
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]