yuxian0908 commented on code in PR #8503:
URL: https://github.com/apache/ozone/pull/8503#discussion_r2148144249


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotDiffJob.java:
##########
@@ -316,12 +316,17 @@ public Class<SnapshotDiffJob> getTypeClass() {
 
     @Override
     public byte[] toPersistedFormatImpl(SnapshotDiffJob object) throws 
IOException {

Review Comment:
   Updated



##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotDiffJob.java:
##########
@@ -316,12 +316,17 @@ public Class<SnapshotDiffJob> getTypeClass() {
 
     @Override
     public byte[] toPersistedFormatImpl(SnapshotDiffJob object) throws 
IOException {
-      return MAPPER.writeValueAsBytes(object);
+      return object.toProtoBuf().toByteArray();
     }
 
     @Override
     public SnapshotDiffJob fromPersistedFormatImpl(byte[] rawData) throws 
IOException {
-      return MAPPER.readValue(rawData, SnapshotDiffJob.class);
+      try {
+        SnapshotDiffJobProto proto = SnapshotDiffJobProto.parseFrom(rawData);
+        return SnapshotDiffJob.getFromProtoBuf(proto);
+      } catch (IOException e) {

Review Comment:
   Updated



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