xBis7 commented on code in PR #4824:
URL: https://github.com/apache/ozone/pull/4824#discussion_r1226530188
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java:
##########
@@ -681,6 +686,37 @@ public SnapshotDiffResponse getSnapshotDiffReport(final
String volume,
return snapshotDiffReport;
}
+ public List<SnapshotDiffJob> getSnapshotDiffList(final String volumeName,
+ final String bucketName,
+ final String jobStatus,
+ final boolean listAll)
+ throws IOException {
+ String volumeKey = ozoneManager.getMetadataManager()
+ .getVolumeKey(volumeName);
+ String bucketKey = ozoneManager.getMetadataManager()
+ .getBucketKey(volumeName, bucketName);
+
+ if (ozoneManager.getMetadataManager()
+ .getVolumeTable().getIfExist(volumeKey) == null ||
+ ozoneManager.getMetadataManager()
+ .getBucketTable().getIfExist(bucketKey) == null) {
+ throw new IOException("Provided volume name " + volumeName +
+ " or bucket name " + bucketName + " doesn't exist");
+ }
+ OmMetadataManagerImpl omMetadataManager = (OmMetadataManagerImpl)
+ ozoneManager.getMetadataManager();
+ SnapshotChainManager snapshotChainManager =
+ omMetadataManager.getSnapshotChainManager();
+ String snapshotPath = volumeName + OM_KEY_PREFIX + bucketName;
+ if (snapshotChainManager.getSnapshotChainPath(snapshotPath) == null) {
+ throw new IOException("There are no snapshots under path " +
Review Comment:
It's gonna return an empty response anyway. We can avoid iterating the
snapshotDiffJob table by returning the empty response right there.
--
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]