-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
chore:use serializer instead of codec #2097
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2097 +/- ##
=============================================
+ Coverage 54.37% 54.38% +<.01%
Complexity 2467 2467
=============================================
Files 445 445
Lines 14753 14742 -11
Branches 1737 1734 -3
=============================================
- Hits 8022 8017 -5
+ Misses 5969 5964 -5
+ Partials 762 761 -1
|
@@ -91,8 +91,8 @@ public void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) { | |||
if (messageType != ProtocolConstants.MSGTYPE_HEARTBEAT_REQUEST | |||
&& messageType != ProtocolConstants.MSGTYPE_HEARTBEAT_RESPONSE) { | |||
// heartbeat has no body | |||
Codec codec = CodecFactory.getCodec(rpcMessage.getCodec()); | |||
bodyBytes = codec.encode(rpcMessage.getBody()); | |||
Serializer codec = SerializerFactory.getSerializer(rpcMessage.getCodec()); |
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.
should change the variable name to serializer
@@ -137,8 +137,8 @@ public Object decodeFrame(ByteBuf frame) { | |||
frame.readBytes(bs); | |||
Compressor compressor = CompressorFactory.getCompressor(compressorType); | |||
bs = compressor.decompress(bs); | |||
Codec codec = CodecFactory.getCodec(codecType); | |||
rpcMessage.setBody(codec.decode(bs)); | |||
Serializer codec = SerializerFactory.getSerializer(codecType); |
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.
should change the variable name to serializer.
codecov.yml
Outdated
@@ -11,7 +11,7 @@ coverage: | |||
precision: 2 | |||
range: "50...100" | |||
ignore: | |||
- "codec/seata-codec-protobuf/src/main/java/io/seata/codec/protobuf/generated" | |||
- "codec/seata-serializer-protobuf/src/main/java/io/seata/codec/protobuf/generated" |
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.
Is it the path of codec should change to serializer too?
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.
Is it the path of codec should change to serializer too?
ok
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
|
||
private static HessianCodec hessianCodec; | ||
private static HessianSerializer hessianCodec; |
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.
hessianCodec -> serializer
|
||
private static KryoCodec kryoCodec; | ||
private static KryoSerializer kryoCodec; |
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.
kryoCodec -> serializer
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
* 'develop' of https://github.com/seata/seata: (125 commits) optimize: tcc module code style (apache#2103) refactor: change the package path of MySQL recognizer (apache#2125) optimize: fix query typo (apache#2176) refactor: add sql parser type druid as constant (apache#2156) test: enhance test coverage of seata common (apache#2170) optimize: gracefully close resources (apache#2139) Feature: Saga provide a switch to skip branch report on branch success, in order to optimize performance. (apache#2151) chore:use serializer instead of codec (apache#2097) optimize: spring module code style (apache#2159) optimize: Add Dubbo compatibility (apache#2036) optimize : seata-rm-datasource module code style (apache#2062) bugfix: Saga report branch status incorrect when service retried succeed (apache#2145) optimize:optimize log specifications (apache#2146) bugfix: when branchRollback failed, it will trigger retry of multi-tc. (apache#2113) refactor: create sql parser spi and a druid type sql parser (apache#1703) refactor: simplify to make seata-common more readable (apache#2038) feature: support FastThreadLocalContextCore (apache#2106) optimize: some typos (apache#2120) optimize: increase the oracle table meta cache code coverage (apache#2078) optimize: some typos (apache#2115) ... # Conflicts: # pom.xml
Ⅰ. Describe what this PR did
codec is not a good name for this scene.
Ⅱ. 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