if (op != null && op.isTimedOut()) {
public T get(long duration, TimeUnit units) throws InterruptedException, TimeoutException, ExecutionException { if(!latch.await(duration, units)) { // whenever timeout occurs, continuous timeout counter will increase by 1. MemcachedConnection.opTimedOut(op); if (op != null) { // op can be null on a flush op.timeOut(); } throw new CheckedOperationTimeoutException( "Timed out waiting for operation", op); } else { // continuous timeout counter will be reset MemcachedConnection.opSucceeded(op); } if(op != null && op.hasErrored()) { throw new ExecutionException(op.getException()); } if(isCancelled()) { throw new ExecutionException(new RuntimeException("Cancelled")); } if(op != null && op.isTimedOut()) { throw new ExecutionException(new CheckedOperationTimeoutException("Operation timed out.", op)); } return objRef.get(); }
throw new ExecutionException(new CancellationException("Cancelled")); if (op != null && op.isTimedOut()) { throw new ExecutionException(new CheckedOperationTimeoutException( "Operation timed out.", op));
throw new ExecutionException(new CancellationException("Cancelled")); if (op != null && op.isTimedOut()) { throw new ExecutionException(new CheckedOperationTimeoutException( "Operation timed out.", op));
throw new ExecutionException(new RuntimeException("Cancelled")); if (op != null && op.isTimedOut()) { throw new ExecutionException(new CheckedOperationTimeoutException( "Operation timed out.", op));
private void redistributeOperations(Collection<Operation> ops) { for (Operation op : ops) { if (op.isCancelled() || op.isTimedOut()) { continue; } if (op instanceof KeyedOperation) { KeyedOperation ko = (KeyedOperation) op; int added = 0; for (String k : ko.getKeys()) { for (Operation newop : opFact.clone(ko)) { addOperation(k, newop); added++; } } assert added > 0 : "Didn't add any new operations when redistributing"; } else { // Cancel things that don't have definite targets. op.cancel(); } } }
return; if (o != null && o.isTimedOut(defaultOpTimeout)) { getLogger().debug("Not writing timed out op."); Operation timedOutOp = removeCurrentWriteOp();
private Operation getNextWritableOp() { Operation o = getCurrentWriteOp(); while (o != null && o.getState() == OperationState.WRITE_QUEUED) { synchronized(o) { if (o.isCancelled()) { getLogger().debug("Not writing cancelled op."); Operation cancelledOp = removeCurrentWriteOp(); assert o == cancelledOp; } else if (o.isTimedOut(defaultOpTimeout)) { getLogger().debug("Not writing timed out op."); Operation timedOutOp = removeCurrentWriteOp(); assert o == timedOutOp; } else { o.writing(); if (!(o instanceof TapAckOperationImpl)) { readQ.add(o); } return o; } o = getCurrentWriteOp(); } } return o; }
private Operation getNextWritableOp() { Operation o = getCurrentWriteOp(); while (o != null && o.getState() == OperationState.WRITE_QUEUED) { synchronized(o) { if (o.isCancelled()) { getLogger().debug("Not writing cancelled op."); Operation cancelledOp = removeCurrentWriteOp(); assert o == cancelledOp; } else if (o.isTimedOut(defaultOpTimeout)) { getLogger().debug("Not writing timed out op."); Operation timedOutOp = removeCurrentWriteOp(); assert o == timedOutOp; } else { o.writing(); if (!(o instanceof TapAckOperationImpl)) { readQ.add(o); } return o; } o = getCurrentWriteOp(); } } return o; }
private Operation getNextWritableOp() { Operation o = getCurrentWriteOp(); while (o != null && o.getState() == OperationState.WRITE_QUEUED) { synchronized(o) { if (o.isCancelled()) { getLogger().debug("Not writing cancelled op."); Operation cancelledOp = removeCurrentWriteOp(); assert o == cancelledOp; } else if (o.isTimedOut(defaultOpTimeout)) { getLogger().debug("Not writing timed out op."); Operation timedOutOp = removeCurrentWriteOp(); assert o == timedOutOp; } else { o.writing(); if (!(o instanceof TapAckOperationImpl)) { readQ.add(o); } return o; } o = getCurrentWriteOp(); } } return o; }
if (op.isCancelled() || op.isTimedOut()) { continue;
if (op.isCancelled() || op.isTimedOut()) { return;
if (op.isCancelled() || op.isTimedOut()) { return;