Skip to content

Commit

Permalink
add shuffle for hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole00 committed Nov 1, 2021
1 parent a3d1634 commit 722aae5
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.io.Serializable;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.flink.connector.nebula.utils.NebulaConstant;
import org.slf4j.Logger;
Expand All @@ -44,6 +45,7 @@ public NebulaPool getNebulaPool() throws UnknownHostException {
addresses.add(new HostAddress(hostAndPort[0], Integer.parseInt(hostAndPort[1])));
}

Collections.shuffle(addresses);
NebulaPool nebulaPool = new NebulaPool();
NebulaPoolConfig poolConfig = new NebulaPoolConfig();
poolConfig.setTimeout(nebulaClientOptions.getTimeout());
Expand Down

0 comments on commit 722aae5

Please sign in to comment.