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

[#133] feat(netty): Introduce ShuffleServerGrpcNettyClient. #839

Merged
merged 5 commits into from
May 8, 2023

Conversation

leixm
Copy link
Contributor

@leixm leixm commented Apr 24, 2023

What changes were proposed in this pull request?

Introduce ShuffleServerGrpcNettyClient.

Why are the changes needed?

for #133

Does this PR introduce any user-facing change?

No.

How was this patch tested?

existing UTs.

@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2023

Codecov Report

Merging #839 (dedc889) into master (4a17a58) will increase coverage by 1.64%.
The diff coverage is 19.34%.

@@             Coverage Diff              @@
##             master     #839      +/-   ##
============================================
+ Coverage     57.09%   58.73%   +1.64%     
- Complexity     2144     2175      +31     
============================================
  Files           321      307      -14     
  Lines         15648    13617    -2031     
  Branches       1243     1262      +19     
============================================
- Hits           8934     7998     -936     
+ Misses         6206     5184    -1022     
+ Partials        508      435      -73     
Impacted Files Coverage Δ
...n/java/org/apache/hadoop/mapreduce/RssMRUtils.java 47.82% <0.00%> (-0.42%) ⬇️
...pache/hadoop/mapreduce/task/reduce/RssShuffle.java 0.00% <0.00%> (ø)
...e/uniffle/client/factory/ShuffleClientFactory.java 0.00% <0.00%> (ø)
...client/request/CreateShuffleReadClientRequest.java 0.00% <0.00%> (ø)
...e/uniffle/common/netty/client/TransportClient.java 18.33% <0.00%> (-3.67%) ⬇️
...fle/client/factory/ShuffleServerClientFactory.java 0.00% <0.00%> (ø)
...ffle/client/impl/grpc/ShuffleServerGrpcClient.java 0.00% <0.00%> (ø)
...client/impl/grpc/ShuffleServerGrpcNettyClient.java 0.00% <0.00%> (ø)
...nt/response/RssGetInMemoryShuffleDataResponse.java 0.00% <ø> (ø)
...fle/client/response/RssGetShuffleDataResponse.java 0.00% <ø> (ø)
... and 12 more

... and 43 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@leixm
Copy link
Contributor Author

leixm commented Apr 25, 2023

cc @smallzhongfeng PTAL.

@leixm
Copy link
Contributor Author

leixm commented Apr 25, 2023

It seems a bit messy at the moment. Some codes use ByteBuffer, such as FixedSizeSegmentSplitter and ShuffleReadClientImpl, and some codes use ByteBuf, such as netty client or protocol objects. At present, I prefer to use ByteBuf in nettyclient, and keep ByteBuffer in other places.

@smallzhongfeng
Copy link
Contributor

It seems a bit messy at the moment. Some codes use ByteBuffer, such as FixedSizeSegmentSplitter and ShuffleReadClientImpl, and some codes use ByteBuf, such as netty client or protocol objects. At present, I prefer to use ByteBuf in nettyclient, and keep ByteBuffer in other places.

+1 for this change. but also cc @jerqi

Copy link
Contributor

@smallzhongfeng smallzhongfeng left a comment

Choose a reason for hiding this comment

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

LGTM except for some minor changes.

long start = System.currentTimeMillis();
RpcResponse rpcResponse = transportClient.sendRpcSync(sendShuffleDataRequest, RPC_TIMEOUT_DEFAULT_MS);
LOG.debug("Do sendShuffleData to {}:{} rpc cost:" + (System.currentTimeMillis() - start)
+ " ms for " + allocateSize + " bytes with " + finalBlockNum + " blocks", host, port);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: code Indent

+ " ms for " + allocateSize + " bytes with " + finalBlockNum + " blocks", host, port);
if (rpcResponse.getStatusCode() != StatusCode.SUCCESS) {
String msg = "Can't send shuffle data with " + finalBlockNum
+ " blocks to " + host + ":" + port
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: code Indent

request.getExpectedTaskIds()
);
String requestInfo = "appId[" + request.getAppId()
+ "], shuffleId[" + request.getShuffleId()
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@jerqi
Copy link
Contributor

jerqi commented Apr 26, 2023

It seems a bit messy at the moment. Some codes use ByteBuffer, such as FixedSizeSegmentSplitter and ShuffleReadClientImpl, and some codes use ByteBuf, such as netty client or protocol objects. At present, I prefer to use ByteBuf in nettyclient, and keep ByteBuffer in other places.

OK for me.

@@ -79,7 +80,8 @@ public ShuffleReadClientImpl(
IdHelper idHelper,
ShuffleDataDistributionType dataDistributionType,
boolean expectedTaskIdsBitmapFilterEnable,
boolean offHeapEnabled) {
boolean offHeapEnabled,
RssConf rssConf) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can reduce some parameters of constructor method if we pass the rssConf to the ShuffleReadClientImpl actually.

leixianming added 2 commits May 8, 2023 10:36
@leixm
Copy link
Contributor Author

leixm commented May 8, 2023

@smallzhongfeng @jerqi PTAL.

Copy link
Contributor

@jerqi jerqi left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@smallzhongfeng smallzhongfeng left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @leixm

@jerqi jerqi merged commit 6bd8d13 into apache:master May 8, 2023
23 checks passed
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

4 participants