swamirishi commented on code in PR #7193:
URL: https://github.com/apache/ozone/pull/7193#discussion_r1774124544
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotUtils.java:
##########
@@ -282,4 +318,34 @@ private static boolean
isSameAsLatestOmKeyInfo(List<OmKeyInfo> omKeyInfos,
}
return false;
}
+
+ public static SnapshotInfo getLatestSnapshotInfo(String volumeName, String
bucketName,
+ OzoneManager ozoneManager,
+ SnapshotChainManager
snapshotChainManager) throws IOException {
+ Optional<UUID> latestPathSnapshot = Optional.ofNullable(
+ getLatestSnapshotId(volumeName, bucketName, snapshotChainManager));
+ return latestPathSnapshot.isPresent() ?
+ getSnapshotInfo(ozoneManager, snapshotChainManager,
latestPathSnapshot.get()) : null;
+ }
+
+ public static UUID getLatestSnapshotId(String volumeName, String bucketName,
+ SnapshotChainManager
snapshotChainManager) throws IOException {
+ String snapshotPath = volumeName + OM_KEY_PREFIX + bucketName;
+ return snapshotChainManager.getLatestPathSnapshotId(snapshotPath);
+ }
+
+ // Validates previous snapshotId given a snapshotInfo or volumeName &
bucketName. Incase snapshotInfo is null, this
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]