SaketaChalamchala commented on code in PR #9985:
URL: https://github.com/apache/ozone/pull/9985#discussion_r3103314158
##########
hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/snapshot/SnapshotDiffHandler.java:
##########
@@ -109,15 +117,43 @@ protected void execute(OzoneClient client, OzoneAddress
address)
if (cancel) {
cancelSnapshotDiff(client.getObjectStore(), volumeName, bucketName);
- } else {
+ } else if (getReport) {
getSnapshotDiff(client.getObjectStore(), volumeName, bucketName);
+ } else {
+ submitSnapshotDiff(client.getObjectStore(), volumeName, bucketName);
+ }
+ }
+
+ private void submitSnapshotDiff(ObjectStore store, String volumeName,
+ String bucketName) throws IOException {
+ SubmitSnapshotDiffResponse response;
+ try {
+ response = store.submitSnapshotDiff(volumeName, bucketName,
fromSnapshot, toSnapshot,
+ forceFullDiff, diffDisableNativeLibs);
+ } catch (OMException ex) {
+ // submit snapshot diff falls back to legacy snapshotDiff is server does
not support it.
+ if (ex.getResult() == OMException.ResultCodes.NOT_SUPPORTED_OPERATION) {
+ SnapshotDiffResponse diffResponse = store.snapshotDiff(volumeName,
bucketName, fromSnapshot, toSnapshot,
+ token, pageSize, forceFullDiff, diffDisableNativeLibs);
+ try (PrintWriter writer = out()) {
+ if (json) {
+
writer.println(toJsonStringWithDefaultPrettyPrinter(getJsonObject(diffResponse)));
+ } else {
+ writer.println(diffResponse);
+ }
+ }
+ }
+ return;
Review Comment:
Fixed with the new commit
--
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]