Github user anmolnar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/534#discussion_r195964179
  
    --- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
    @@ -149,15 +185,12 @@ public 
StaticHostProvider(Collection<InetSocketAddress> serverAddresses,
          * @param currentHost the host to which this client is currently 
connected
          * @return true if changing connections is necessary for 
load-balancing, false otherwise  
          */
    -
    -
         @Override
         public synchronized boolean updateServerList(
                 Collection<InetSocketAddress> serverAddresses,
                 InetSocketAddress currentHost) {
    -        // Resolve server addresses and shuffle them
    -        List<InetSocketAddress> resolvedList = 
resolveAndShuffle(serverAddresses);
    -        if (resolvedList.isEmpty()) {
    +        List<InetSocketAddress> shuffledList = shuffle(serverAddresses);
    --- End diff --
    
    `resolveAndShuffle` has been split into two methods: `resolve` and 
`shuffle`, because we have to do it separately. Github shows the diff as 
original has been renamed and new one has been created.
    
    I'll double check the rebalance functionality to make sure it's working 
properly and will also check related unit tests. I think what @lvfangmin is 
saying makes sense.


---

Reply via email to