Skip to content
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

Merged
merged 5 commits into from
Jan 10, 2020
Merged

chore:use serializer instead of codec #2097

merged 5 commits into from
Jan 10, 2020

Conversation

leizhiyuan
Copy link
Contributor

@leizhiyuan leizhiyuan commented Dec 26, 2019

Ⅰ. 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

@codecov-io
Copy link

codecov-io commented Dec 26, 2019

Codecov Report

Merging #2097 into develop will increase coverage by <.01%.
The diff coverage is 24.13%.

Impacted file tree graph

@@              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
Impacted Files Coverage Δ Complexity Δ
...g/annotation/datasource/DataSourceProxyHolder.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...java/io/seata/spring/tcc/TccActionInterceptor.java 13.15% <0%> (+0.65%) 2 <0> (ø) ⬇️
...ava/io/seata/rm/tcc/remoting/parser/DubboUtil.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ing/annotation/GlobalTransactionalInterceptor.java 10% <0%> (ø) 2 <0> (ø) ⬇️
...in/java/io/seata/spring/util/SpringProxyUtils.java 1.69% <25%> (-1.54%) 3 <0> (ø)
...ta/spring/annotation/GlobalTransactionScanner.java 48.21% <33.33%> (-0.04%) 17 <5> (ø)
.../java/io/seata/spring/util/TCCBeanParserUtils.java 43.9% <50%> (-2.77%) 8 <0> (ø)

@slievrly slievrly self-requested a review December 27, 2019 02:47
@@ -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());
Copy link
Contributor

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);
Copy link
Contributor

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"
Copy link
Contributor

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?

Copy link
Contributor Author

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

@zjinlei zjinlei added this to the 1.1.0 milestone Jan 2, 2020
Copy link
Member

@slievrly slievrly left a 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;
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kryoCodec -> serializer

Copy link
Member

@lovepoem lovepoem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lovepoem lovepoem merged commit b179c78 into apache:develop Jan 10, 2020
dangquocbang pushed a commit to dangquocbang/seata that referenced this pull request Jan 14, 2020
* '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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants