hemantk-12 commented on code in PR #4264:
URL: https://github.com/apache/ozone/pull/4264#discussion_r1126765834


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/snapshot/SnapshotDiffReport.java:
##########
@@ -199,14 +208,20 @@ public List<DiffReportEntry> getDiffList() {
   @Override
   public String toString() {
     StringBuilder str = new StringBuilder();
-    String from = "snapshot " + fromSnapshot;
-    String to = "snapshot " + toSnapshot;
-    str.append("Difference between ").append(from).append(" and ").append(to)
-        .append(":")
+    str.append("Difference between snapshot: ")
+        .append(fromSnapshot)
+        .append(" and snapshot: ")
+        .append(toSnapshot)
+        .append(",")

Review Comment:
   I felt it is better to have it. Removed it.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerRequestHandler.java:
##########
@@ -1219,11 +1219,26 @@ private GetS3VolumeContextResponse getS3VolumeContext()
 
   private SnapshotDiffResponse snapshotDiff(
       SnapshotDiffRequest snapshotDiffRequest) throws IOException {
-    return SnapshotDiffResponse.newBuilder().setSnapshotDiffReport(
-        impl.snapshotDiff(snapshotDiffRequest.getVolumeName(),
+    org.apache.hadoop.ozone.snapshot.SnapshotDiffResponse response =
+        impl.snapshotDiff(
+            snapshotDiffRequest.getVolumeName(),
             snapshotDiffRequest.getBucketName(),
             snapshotDiffRequest.getFromSnapshot(),
-            snapshotDiffRequest.getToSnapshot()).toProtobuf()).build();
+            snapshotDiffRequest.getToSnapshot(),
+            snapshotDiffRequest.getToken(),
+            snapshotDiffRequest.getPageSize());
+
+    OzoneManagerProtocolProtos.SnapshotDiffReportProto snapshotDiffReportProto;
+    if (response.getSnapshotDiffReport() == null) {
+      snapshotDiffReportProto = null;
+    } else {
+      snapshotDiffReportProto = response.getSnapshotDiffReport().toProtobuf();
+    }
+
+    return SnapshotDiffResponse.newBuilder()
+        .setSnapshotDiffReport(snapshotDiffReportProto)

Review Comment:
   Updated it to set only if it is not null.
   
   We don't have test case as part of this change. I'll check make sure to add 
test while doing server side change.



-- 
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]

Reply via email to