-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize: kryo 5.4.0 compatibility with jdk17 #5243
Conversation
@@ -71,7 +71,7 @@ | |||
|
|||
<protobuf.version>3.11.4</protobuf.version> | |||
<grpc.version>1.27.1</grpc.version> | |||
<kryo.version>5.3.0</kryo.version> | |||
<kryo.version>5.4.0</kryo.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kryo.register(Arrays.asList("").getClass(), new ArraysAsListSerializer());
kryo.register(GregorianCalendar.class, new GregorianCalendarSerializer());
这两段在jdk17使用到KryoSerializerFactory kryo序列化上会报错,有测试过吗?我的另一个pr里改为了
kryo.register(Collections.singletonList("").getClass());
kryo.register(GregorianCalendar.class);
后可兼容jdk17,5.4.0上老的方式,注册了指定的序列化器进去能兼容吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kryo.register(Arrays.asList("").getClass(), new ArraysAsListSerializer()); kryo.register(GregorianCalendar.class, new GregorianCalendarSerializer());
这两段在jdk17使用到KryoSerializerFactory kryo序列化上会报错,有测试过吗?我的另一个pr里改为了 kryo.register(Collections.singletonList("").getClass()); kryo.register(GregorianCalendar.class); 后可兼容jdk17,5.4.0上老的方式,注册了指定的序列化器进去能兼容吗?
我测试一下看看
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kryo.register(Arrays.asList("").getClass(), new ArraysAsListSerializer()); kryo.register(GregorianCalendar.class, new GregorianCalendarSerializer());
这两段在jdk17使用到KryoSerializerFactory kryo序列化上会报错,有测试过吗?我的另一个pr里改为了 kryo.register(Collections.singletonList("").getClass()); kryo.register(GregorianCalendar.class); 后可兼容jdk17,5.4.0上老的方式,注册了指定的序列化器进去能兼容吗?
源码中是这样的 单测都是通过的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码风格问题,看下提示的地方进行code format之类的就像了,往这个日志上面翻翻有具体提示的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
简单点可以直接不放进去序列化器,让kryo自适应
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
顺便把上面测试jdk17的兼容性代码弄个测试用例放进去吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
顺便把上面测试jdk17的兼容性代码弄个测试用例放进去吧
妥了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看还没提交上来呀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看还没提交上来呀
刚提交了
Codecov Report
@@ Coverage Diff @@
## develop #5243 +/- ##
=============================================
- Coverage 48.48% 48.48% -0.01%
Complexity 4139 4139
=============================================
Files 743 743
Lines 26520 26518 -2
Branches 3294 3294
=============================================
- Hits 12857 12856 -1
Misses 12263 12263
+ Partials 1400 1399 -1
|
add 增加 单测测试 KryoSerializerFactory 可用性
...izer/seata-serializer-kryo/src/main/java/io/seata/serializer/kryo/KryoSerializerFactory.java
Outdated
Show resolved
Hide resolved
serializer/seata-serializer-kryo/src/test/java/io/seata/serializer/kryo/KryoSerializerTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @jsbxyyx PTAL
core/src/main/java/io/seata/core/serializer/SerializerClassRegistry.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews