You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "jerqi (via GitHub)" <gi...@apache.org> on 2023/04/04 02:26:34 UTC
[GitHub] [incubator-uniffle] jerqi commented on pull request #792: [#720][FOLLOW-UP] Correct the shuffle server id
jerqi commented on PR #792:
URL: https://github.com/apache/incubator-uniffle/pull/792#issuecomment-1495250350
> I have an idea for `ShuffleServerId`, and `new ShuffleFlushManager with Future<String> shuffleServerId`
>
> ```
> public class ShuffleServerIdCreator {
>
> private String ip;
> private Integer grpcPortConf;
> private Integer nettyPortConf;
>
> private final ExecutorService executor = Executors.newSingleThreadExecutor();
> private final SynchronousQueue<Integer> nettyPortFuture = new SynchronousQueue();
>
> public ShuffleServerIdCreator(String ip, Integer grpcPortConf, Integer nettyPortConf) {
> this.ip = ip;
> this.grpcPortConf = grpcPortConf;
> this.nettyPortConf = nettyPortConf;
> }
>
> public Future<String> create() {
> return executor.submit(() -> {
> if (nettyPortConf > 0) {
> return ip + "-" + grpcPortConf + "-" + nettyPortConf;
> } else if (nettyPortConf == 0) {
> return ip + "-" + grpcPortConf + "-" + nettyPortFuture.take();
> } else {
> return ip + "-" + grpcPortConf;
> }
> });
> }
>
> public void setNettyActualPort(int actualNettyPort) {
> nettyPortFuture.offer(actualNettyPort);
> }
> }
> ```
A little complex. I fix this issue in another way. You can take a look.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org