Skip to content

Fix ContentTypeId conflict#3967

Merged
beiwei30 merged 5 commits intoapache:masterfrom
CrazyHZM:avroSerializationId
May 5, 2019
Merged

Fix ContentTypeId conflict#3967
beiwei30 merged 5 commits intoapache:masterfrom
CrazyHZM:avroSerializationId

Conversation

@CrazyHZM
Copy link
Copy Markdown
Member

@CrazyHZM CrazyHZM commented May 1, 2019

What is the purpose of the change

Fix Serialization ContentTypeId conflict between avro protocol and protocoluff protocol #3926

Brief changelog

XXXXX

Verifying this change

XXXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@codecov-io
Copy link
Copy Markdown

codecov-io commented May 1, 2019

Codecov Report

Merging #3967 into master will increase coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3967      +/-   ##
============================================
+ Coverage     63.58%   63.58%   +<.01%     
  Complexity      100      100              
============================================
  Files           720      720              
  Lines         31838    31839       +1     
  Branches       5113     5114       +1     
============================================
+ Hits          20245    20246       +1     
  Misses         9273     9273              
  Partials       2320     2320
Impacted Files Coverage Δ Complexity Δ
...c/main/java/org/apache/dubbo/common/Constants.java 93.33% <ø> (ø) 0 <0> (ø) ⬇️
.../serialize/protostuff/ProtostuffSerialization.java 60% <0%> (ø) 0 <0> (ø) ⬇️
.../apache/dubbo/remoting/transport/CodecSupport.java 77.77% <0%> (-3%) 0 <0> (ø)
...dubbo/common/serialize/kryo/KryoSerialization.java 60% <0%> (ø) 0 <0> (ø) ⬇️
...dubbo/common/serialize/java/JavaSerialization.java 80% <100%> (ø) 0 <0> (ø) ⬇️
...mmon/serialize/hessian2/Hessian2Serialization.java 80% <100%> (ø) 0 <0> (ø) ⬇️
...dubbo/common/serialize/avro/AvroSerialization.java 100% <100%> (ø) 0 <0> (ø) ⬇️
...mon/serialize/java/CompactedJavaSerialization.java 80% <100%> (ø) 0 <0> (ø) ⬇️
.../serialize/nativejava/NativeJavaSerialization.java 80% <100%> (ø) 0 <0> (ø) ⬇️
...mmon/serialize/fastjson/FastJsonSerialization.java 100% <100%> (ø) 0 <0> (ø) ⬇️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74a491b...e0d5c00. Read the comment docs.

/**
* Serizlization ContentTypeId
*/
public static final byte AVRO_SERIALIZATION_ID = 1;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is wrong, avro is 10...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

public static final byte AVRO_SERIALIZATION_ID = 11 should be better

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

public static final byte AVRO_SERIALIZATION_ID = 11 should be better

What are the uses of 1 and 5 here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's simply leave it as is. I believe the original intention is: 1, 2, 4, 8, 16...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have modified it.

Copy link
Copy Markdown
Member

@beiwei30 beiwei30 left a comment

Choose a reason for hiding this comment

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

pls. check my comments.

Copy link
Copy Markdown
Member

@beiwei30 beiwei30 left a comment

Choose a reason for hiding this comment

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

LGTM.

@beiwei30 beiwei30 merged commit 89f6d6d into apache:master May 5, 2019
public static final byte PROTOSTUFF_SERIALIZATION_ID = 10;
public static final byte AVRO_SERIALIZATION_ID = 11;
public static final byte GSON_SERIALIZATION_ID = 16;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe you can define a sub-constant class. What do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 for a specific constants class

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think this suggestion is good, I will modify it later.

@CrazyHZM CrazyHZM mentioned this pull request May 6, 2019
6 tasks
@CrazyHZM CrazyHZM deleted the avroSerializationId branch May 14, 2019 09:26
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.

5 participants