You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "eric9204 (via GitHub)" <gi...@apache.org> on 2023/08/02 01:59:01 UTC

[GitHub] [hudi] eric9204 commented on a diff in pull request #9327: [HUDI-6617] make HoodieRecordDelegate implement KryoSerializable

eric9204 commented on code in PR #9327:
URL: https://github.com/apache/hudi/pull/9327#discussion_r1281302685


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecordDelegate.java:
##########
@@ -122,4 +127,20 @@ public String toString() {
         + ", newLocation=" + newLocation
         + '}';
   }
+
+  @Override
+  public final void write(Kryo kryo, Output output) {
+    kryo.writeObjectOrNull(output, hoodieKey, HoodieKey.class);
+    kryo.writeClassAndObject(output, currentLocation.isPresent() ? currentLocation.get() : null);
+    kryo.writeClassAndObject(output, newLocation.isPresent() ? newLocation.get() : null);
+  }
+
+  @Override
+  public final void read(Kryo kryo, Input input) {
+    this.hoodieKey = kryo.readObjectOrNull(input, HoodieKey.class);
+    HoodieRecordLocation newrl = (HoodieRecordLocation) kryo.readClassAndObject(input);
+    this.currentLocation = newrl == null ? Option.empty() : Option.of(newrl);
+    HoodieRecordLocation oldrl = (HoodieRecordLocation) kryo.readClassAndObject(input);
+    this.newLocation = oldrl == null ? Option.empty() : Option.of(oldrl);
+  }

Review Comment:
   Has been 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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org