aswinshakil commented on code in PR #7193:
URL: https://github.com/apache/ozone/pull/7193#discussion_r1773715401
##########
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,
Review Comment:
Having a clear function name will be better. Because we don't know if the
function will do both if send `null` for `buncketName`
--
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]