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

Default to use netty bytebuf in network layer and remove getAndRelease method #1375

Merged
merged 7 commits into from
Feb 14, 2020

Conversation

justinlin-linkedin
Copy link
Collaborator

This pr includes two changes:

  1. Default to use netty bytebuf in network layer, which will remove lots of code dealing with java bytebuffer
  2. Remove getAndRelease and replace it with content method and implements ByteBufHolder interface.

@codecov-io
Copy link

codecov-io commented Feb 7, 2020

Codecov Report

Merging #1375 into master will increase coverage by 0.15%.
The diff coverage is 58.53%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1375      +/-   ##
============================================
+ Coverage     72.35%   72.51%   +0.15%     
+ Complexity     6867     6861       -6     
============================================
  Files           496      496              
  Lines         38854    38782      -72     
  Branches       4940     4927      -13     
============================================
+ Hits          28113    28122       +9     
+ Misses         9383     9308      -75     
+ Partials       1358     1352       -6
Impacted Files Coverage Δ Complexity Δ
...in/java/com.github.ambry/config/NetworkConfig.java 100% <ø> (ø) 1 <0> (ø) ⬇️
.../main/java/com.github.ambry.router/GetManager.java 90.09% <ø> (ø) 24 <0> (ø) ⬇️
...java/com.github.ambry.router/TtlUpdateManager.java 86.2% <ø> (ø) 15 <0> (ø) ⬇️
...in/java/com.github.ambry.router/DeleteManager.java 85% <ø> (ø) 14 <0> (ø) ⬇️
.../main/java/com.github.ambry.router/PutManager.java 87.09% <ø> (ø) 30 <0> (ø) ⬇️
...ain/java/com.github.ambry/config/RouterConfig.java 97.8% <ø> (-0.03%) 1 <0> (ø)
.../com.github.ambry/tools/admin/ServerAdminTool.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...github.ambry/tools/perf/ServerReadPerformance.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ava/com.github.ambry/store/HardDeleteVerifier.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...va/com.github.ambry/tools/admin/BlobValidator.java 0% <0%> (ø) 0 <0> (ø) ⬇️
... and 32 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 6f407d1...25be8c8. Read the comment docs.

Copy link
Contributor

@jsjtzyy jsjtzyy left a comment

Choose a reason for hiding this comment

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

a few comments

SocketServerRequest req = new SocketServerRequest(id, connectionId, buffer,
Utils.createDataInputStreamFromBuffer(buffer, networkConfig.networkPutRequestShareMemory));
ByteBuf buffer = networkReceive.getReceivedBytes().content();
SocketServerRequest req = new SocketServerRequest(id, connectionId, buffer);
Copy link
Contributor

Choose a reason for hiding this comment

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

who is supposed to release the buffer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in the RequestHandler, we have a for loop to get the request out and after dealing with the request, we release it.

@jsjtzyy jsjtzyy merged commit 75388d9 into linkedin:master Feb 14, 2020
@justinlin-linkedin justinlin-linkedin deleted the getandrelease branch February 14, 2020 22:33
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.

4 participants