yuxian0908 commented on code in PR #8503:
URL: https://github.com/apache/ozone/pull/8503#discussion_r2117121812
##########
hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/helpers/TestOmSnapshotDiffJobCodec.java:
##########
@@ -0,0 +1,57 @@
+package org.apache.hadoop.ozone.om.helpers;
+
+import org.apache.hadoop.hdds.utils.db.Codec;
+import org.apache.hadoop.ozone.snapshot.SnapshotDiffResponse.JobStatus;
+import org.apache.hadoop.ozone.snapshot.SnapshotDiffResponse.SubStatus;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+
+/**
+ * Testing serialization of SnapshotDiffJobCodec objects to/from RocksDB.
+ */
+public class TestOmSnapshotDiffJobCodec {
+ private final OldSnapshotDiffJobCodecForTesting oldCodec
+ = new OldSnapshotDiffJobCodecForTesting();
+ private final Codec<SnapshotDiffJob> newCodec = SnapshotDiffJob.getCodec();
+
+ @Test
+ public void testOldJsonSerializedDataCanBeReadByNewCodec() throws Exception {
Review Comment:
getFromProtoBuf() appears to be a safe method that builds a POJO from a
fully-parsed SnapshotDiffJobProto object. Since it relies on accessor methods
like getCreationTime() and getVolume() which are expected to be present in a
valid proto message, we don’t anticipate any checked exceptions being thrown
during this process.
Please correct me if I missed anything or overlooked a potential edge case.
--
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]