for(int index : actualReplicaIndexes) {
final CountDownLatch latch = new CountDownLatch(1);
final OperationFuture<CASValue<T>> rv =
new OperationFuture<CASValue<T>>(key, latch, operationTimeout, executorService);
Operation op = createOperationForReplicaGets(key, rv, replicaFuture,
latch, tc, index, true);
rv.setOperation(op);
mconn.enqueueOperation(key, op);
if (op.isCancelled()) {
discardedOps++;
getLogger().debug("Silently discarding replica get for key \""
+ key + "\" (cancelled).");
} else {
replicaFuture.addFutureToMonitor(rv);
}
}
if (locator.hasActiveMaster(key)) {
final CountDownLatch latch = new CountDownLatch(1);
final OperationFuture<CASValue<T>> additionalActiveGet =
new OperationFuture<CASValue<T>>(key, latch, operationTimeout, executorService);
Operation op = createOperationForReplicaGets(key, additionalActiveGet,
replicaFuture, latch, tc, 0, false);
additionalActiveGet.setOperation(op);
mconn.enqueueOperation(key, op);
if (op.isCancelled()) {
discardedOps++;
getLogger().debug("Silently discarding replica (active) get for key \""
+ key + "\" (cancelled).");
} else {
replicaFuture.addFutureToMonitor(additionalActiveGet);