alexeykudinkin commented on code in PR #6977:
URL: https://github.com/apache/hudi/pull/6977#discussion_r999843699


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java:
##########
@@ -282,6 +287,47 @@ public void checkState() {
     }
   }
 
+  protected abstract void writeRecordPayload(T payload, Kryo kryo, Output 
output);
+
+  protected abstract T readRecordPayload(Kryo kryo, Input input);
+
+  /**
+   * NOTE: This method is declared final to make sure there's no polymorphism 
and therefore
+   *       JIT compiler could perform more aggressive optimizations
+   */
+  @Override
+  public final void write(Kryo kryo, Output output) {
+    Serializer recLocSerializer = 
kryo.getSerializer(HoodieRecordLocation.class);
+
+    kryo.writeObjectOrNull(output, key, HoodieKey.class);
+    kryo.writeObjectOrNull(output, currentLocation, recLocSerializer);
+    kryo.writeObjectOrNull(output, newLocation, recLocSerializer);

Review Comment:
   It's less about performance gains in the `HoodieRecord` per se and more 
about fixing ser/de for `HoodieSparkRecord`
   
    - Previous PR actually removed mandatory conversion to `UnsafeRow` w/in the 
`HoodieSparkRecord` (for performance reasons)
    - Conversion to `UnsafeRow` is still required though upon ser/de (for 
shuffling). This change is to handle that.



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

Reply via email to