eric9204 commented on code in PR #9327: URL: https://github.com/apache/hudi/pull/9327#discussion_r1282589478
########## hudi-common/src/test/java/org/apache/hudi/common/model/TestHoodieRecordDelegate.java: ########## @@ -70,4 +78,24 @@ public void testKryoSerializeDeserialize() { assertEquals(new HoodieRecordLocation("001", "file01"), hoodieRecordDelegate.getCurrentLocation().get()); assertEquals(new HoodieRecordLocation("001", "file-01"), hoodieRecordDelegate.getNewLocation().get()); } + + public Kryo getKryoInstance() { + final Kryo kryo = new Kryo(); + // This instance of Kryo should not require prior registration of classes + kryo.setRegistrationRequired(false); + kryo.setInstantiatorStrategy(new Kryo.DefaultInstantiatorStrategy(new StdInstantiatorStrategy())); + // Handle cases where we may have an odd classloader setup like with libjars + // for hadoop + kryo.setClassLoader(Thread.currentThread().getContextClassLoader()); + + // Register Hudi's classes + new HoodieCommonKryoRegistrar().registerClasses(kryo); + + // Register serializers + kryo.register(Utf8.class, new SerializationUtils.AvroUtf8Serializer()); + kryo.register(GenericData.Fixed.class, new GenericAvroSerializer<>()); Review Comment: No, the member variable types of `HoodieRecordDelegate` don't contain avro.that should't be registered. 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-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org