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

[#782]refactor: restrict rss.rpc.server.type to an enum #783

Merged
merged 5 commits into from
Apr 4, 2023

Conversation

advancedxy
Copy link
Contributor

What changes were proposed in this pull request?

  1. make RPC_SERVER_TYPE an enum
  2. remove ServerType definition in various places

Why are the changes needed?

This resolves #782

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing UTs

@advancedxy advancedxy requested a review from zuston March 30, 2023 06:26
@advancedxy advancedxy changed the title refactor: restrict rss.rpc.server.type to an enum [#782]refactor: restrict rss.rpc.server.type to an enum Mar 30, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2023

Codecov Report

Merging #783 (9331499) into master (ea5a3ba) will increase coverage by 1.62%.
The diff coverage is 83.33%.

@@             Coverage Diff              @@
##             master     #783      +/-   ##
============================================
+ Coverage     57.86%   59.49%   +1.62%     
- Complexity     2028     2070      +42     
============================================
  Files           298      290       -8     
  Lines         14520    12840    -1680     
  Branches       1185     1212      +27     
============================================
- Hits           8402     7639     -763     
+ Misses         5643     4771     -872     
+ Partials        475      430      -45     
Impacted Files Coverage Δ
...apache/uniffle/coordinator/CoordinatorFactory.java 81.81% <50.00%> (-2.80%) ⬇️
...rg/apache/uniffle/server/ShuffleServerFactory.java 73.33% <50.00%> (-3.14%) ⬇️
...e/shuffle/manager/ShuffleManagerServerFactory.java 92.85% <100.00%> (-0.90%) ⬇️
.../org/apache/uniffle/common/config/RssBaseConf.java 94.53% <100.00%> (+0.48%) ⬆️
...java/org/apache/uniffle/common/rpc/ServerType.java 100.00% <100.00%> (ø)

... and 30 files with indirect coverage changes

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

zuston
zuston previously approved these changes Mar 30, 2023
Copy link
Member

@zuston zuston left a comment

Choose a reason for hiding this comment

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

LGTM. plz fix the CI

smallzhongfeng
smallzhongfeng previously approved these changes Mar 31, 2023
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.

+1 for this change

@jerqi
Copy link
Contributor

jerqi commented Mar 31, 2023

Should we add some check in the line

nettyServerEnabled = shuffleServerConf.get(ShuffleServerConf.NETTY_SERVER_PORT) >= 0;

@advancedxy
Copy link
Contributor Author

Should we add some check in the line

nettyServerEnabled = shuffleServerConf.get(ShuffleServerConf.NETTY_SERVER_PORT) >= 0;

I don't get your point. could you elaborate a bit more on it?

@jerqi
Copy link
Contributor

jerqi commented Mar 31, 2023

Should we add some check in the line

nettyServerEnabled = shuffleServerConf.get(ShuffleServerConf.NETTY_SERVER_PORT) >= 0;

I don't get your point. could you elaborate a bit more on it?

If rpc.server.typeisGrpcandnetty port` is greater than 0, we should throw a exception.

@advancedxy
Copy link
Contributor Author

Should we add some check in the line

nettyServerEnabled = shuffleServerConf.get(ShuffleServerConf.NETTY_SERVER_PORT) >= 0;

I don't get your point. could you elaborate a bit more on it?

If rpc.server.typeisGrpcandnetty port` is greater than 0, we should throw a exception.

I don't think so. If we are going to add the following constraint, users have to modify two settings to enable netty. This adds overhead to user side compared to the current way: set netty port to a non-negative one.

@jerqi
Copy link
Contributor

jerqi commented Apr 3, 2023

Should we add some check in the line

nettyServerEnabled = shuffleServerConf.get(ShuffleServerConf.NETTY_SERVER_PORT) >= 0;

I don't get your point. could you elaborate a bit more on it?

If rpc.server.typeisGrpcandnetty port` is greater than 0, we should throw a exception.

I don't think so. If we are going to add the following constraint, users have to modify two settings to enable netty. This adds overhead to user side compared to the current way: set netty port to a non-negative one.

But if it's inconsistent, it will be confusing.

@advancedxy
Copy link
Contributor Author

But if it's inconsistent, it will be confusing.

I would remove the GRPC_NETTY type then, from the perspective of rpc, there's no such thing as both grpc and netty.

When netty is ready, we can then make netty a dedicate rpc server type.

@jerqi
Copy link
Contributor

jerqi commented Apr 3, 2023

But if it's inconsistent, it will be confusing.

I would remove the GRPC_NETTY type then, from the perspective of rpc, there's no such thing as both grpc and netty.

When netty is ready, we can then make netty a dedicate rpc server type.

OK. LGTM.

jerqi
jerqi previously approved these changes Apr 3, 2023
@advancedxy advancedxy dismissed stale reviews from jerqi, smallzhongfeng, and zuston via 980c1c8 April 3, 2023 08:52
@jerqi
Copy link
Contributor

jerqi commented Apr 3, 2023

Em ..... but the client rpc type is GRPC and GRPC_NETTY. Is it ok?

@advancedxy
Copy link
Contributor Author

Em ..... but the client rpc type is GRPC and GRPC_NETTY. Is it ok?

emmm, I believe the client type might not be appropriate, and it seems never used to configure it in the client side.

We may need to refactor this client type?

@jerqi
Copy link
Contributor

jerqi commented Apr 3, 2023

Em ..... but the client rpc type is GRPC and GRPC_NETTY. Is it ok?

emmm, I believe the client type might not be appropriate, and it seems never used to configure it in the client side.

We may need to refactor this client type?

I think it's suitable. We use the GRPC and NETTY at the same time.

@advancedxy
Copy link
Contributor Author

Em ..... but the client rpc type is GRPC and GRPC_NETTY. Is it ok?

emmm, I believe the client type might not be appropriate, and it seems never used to configure it in the client side.
We may need to refactor this client type?

I think it's suitable. We use the GRPC and NETTY at the same time.

I know. But for rpc type, GRPC_NETTY might not be appropriate. The client might use grpc or grpc_netty both, but it's confused with the rpc type....

The ClientType is also used as ShuffleServer tags, which might not be appropriate. The term ClientType is more like a ServerMode thing. So I think we may reconsider the term client type here.

@jerqi
Copy link
Contributor

jerqi commented Apr 3, 2023

Em ..... but the client rpc type is GRPC and GRPC_NETTY. Is it ok?

emmm, I believe the client type might not be appropriate, and it seems never used to configure it in the client side.
We may need to refactor this client type?

I think it's suitable. We use the GRPC and NETTY at the same time.

I know. But for rpc type, GRPC_NETTY might not be appropriate. The client might use grpc or grpc_netty both, but it's confused with the rpc type....

The ClientType is also used as ShuffleServer tags, which might not be appropriate. The term ClientType is more like a ServerMode thing. So I think we may reconsider the term client type here.

I think your thought will bring more cost that users need to understand. We should simplify the rpc type.

@advancedxy
Copy link
Contributor Author

Em ..... but the client rpc type is GRPC and GRPC_NETTY. Is it ok?

emmm, I believe the client type might not be appropriate, and it seems never used to configure it in the client side.
We may need to refactor this client type?

I think it's suitable. We use the GRPC and NETTY at the same time.

I know. But for rpc type, GRPC_NETTY might not be appropriate. The client might use grpc or grpc_netty both, but it's confused with the rpc type....
The ClientType is also used as ShuffleServer tags, which might not be appropriate. The term ClientType is more like a ServerMode thing. So I think we may reconsider the term client type here.

I think your thought will bring more cost that users need to understand. We should simplify the rpc type.

Maybe, so we need to think it carefully.

@advancedxy
Copy link
Contributor Author

I changed the RPCServerType to ServerType, which should be matched with ClientType.

If rpc.server.typeisGrpcandnetty port` is greater than 0, we should throw a exception.

As for this suggestion, I would like to refactor the ShuffleServer to create netty stream server via ShuffleServerFactory and do validations there.

@jerqi
Copy link
Contributor

jerqi commented Apr 4, 2023

I changed the RPCServerType to ServerType, which should be matched with ClientType.

If rpc.server.typeisGrpcandnetty port` is greater than 0, we should throw a exception.

As for this suggestion, I would like to refactor the ShuffleServer to create netty stream server via ShuffleServerFactory and do validations there.

Ok for me.

@jerqi jerqi merged commit 89f07fb into apache:master Apr 4, 2023
xianjingfeng pushed a commit to xianjingfeng/incubator-uniffle that referenced this pull request Apr 5, 2023
…#783)

### What changes were proposed in this pull request?
1. make RPC_SERVER_TYPE an enum
2. remove ServerType definition in various places

### Why are the changes needed?
This resolves apache#782

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Existing UTs
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.

[Improvement] define RPC_SERVER_TYPE as an enum
5 participants