Beispiel #1
0
 /**
  * Resets the addresses.
  *
  * @return The address selector.
  */
 public AddressSelector reset() {
   if (selectionsIterator != null) {
     this.selections = strategy.selectConnections(leader, new ArrayList<>(servers));
     this.selectionsIterator = null;
   }
   return this;
 }
Beispiel #2
0
 /**
  * Resets the connection addresses.
  *
  * @param servers The collection of server addresses.
  * @return The address selector.
  */
 public AddressSelector reset(Address leader, Collection<Address> servers) {
   if (changed(leader, servers)) {
     this.leader = leader;
     this.servers = servers;
     this.selections = strategy.selectConnections(leader, new ArrayList<>(servers));
     this.selectionsIterator = null;
   }
   return this;
 }