Skip to content

Commit

Permalink
Use set instead of list in round-robin policy
Browse files Browse the repository at this point in the history
  • Loading branch information
olim7t committed May 4, 2017
1 parent c7c2d71 commit ea66526
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -21,6 +21,7 @@
import java.util.Set;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.IntUnaryOperator;
import org.slf4j.Logger;
Expand All @@ -38,7 +39,7 @@ public class RoundRobinLoadBalancingPolicy implements LoadBalancingPolicy {
private static final IntUnaryOperator INCREMENT = i -> (i == Integer.MAX_VALUE) ? 0 : i + 1;

private final AtomicInteger startIndex = new AtomicInteger();
private final CopyOnWriteArrayList<Node> liveNodes = new CopyOnWriteArrayList<>();
private final CopyOnWriteArraySet<Node> liveNodes = new CopyOnWriteArraySet<>();

public RoundRobinLoadBalancingPolicy(@SuppressWarnings("unused") DriverContext context) {
// nothing to do
Expand Down

0 comments on commit ea66526

Please sign in to comment.