return addresses[replicaIndex];
}
void setReplicaAddress(int replicaIndex, Address newAddress) {
boolean changed = false;
Address oldAddress;
for (; ; ) {
Address[] oldAddresses = addresses;
oldAddress = oldAddresses[replicaIndex];
if (partitionListener != null) {
if (oldAddress == null) {
changed = newAddress != null;
} else {
changed = !oldAddress.equals(newAddress);
}
}
Address[] newAddresses = createNewAddresses(replicaIndex, newAddress, oldAddresses);
if (ADDRESSES_UPDATER.compareAndSet(this, oldAddresses, newAddresses)) {