/** * Wrapper method that either inspects the future or not. * * @param future the future to potentially verify. * @return the status of the future result. */ private Status checkFutureStatus(final OperationFuture<?> future) { if (checkFutures) { return future.getStatus().isSuccess() ? Status.OK : Status.ERROR; } else { return Status.OK; } }
protected Status getReturnCode(OperationFuture<Boolean> future) { if (!checkOperationStatus) { return Status.OK; } if (future.getStatus().isSuccess()) { return Status.OK; } else if (TEMPORARY_FAILURE_MSG.equals(future.getStatus().getMessage())) { return new Status("TEMPORARY_FAILURE", TEMPORARY_FAILURE_MSG); } else if (CANCELLED_MSG.equals(future.getStatus().getMessage())) { return new Status("CANCELLED_MSG", CANCELLED_MSG); } return new Status("ERROR", future.getStatus().getMessage()); }
@Override public void receivedStatus(OperationStatus s) { rv.set(new Long(s.isSuccess() ? s.getMessage() : "-1")); final MemcachedNode node = getEVCacheNode(key); if(node instanceof EVCacheNodeImpl) { getCounter("MutateOperation-"+ s.getStatusCode().name(), ((EVCacheNodeImpl)node).getBaseTags()).increment(); } else { getCounter("MutateOperation-"+ s.getStatusCode().name(), BasicTagList.of("HOST", node.getSocketAddress().toString())).increment(); } }
@Override public void receivedStatus(OperationStatus val) { operationDuration.stop(); if (log.isDebugEnabled()) log.debug("Storing Key : " + key + "; Status : " + val.getStatusCode().name() + (log.isTraceEnabled() ? " Node : " + getEVCacheNode(key) : "") + "; Message : " + val.getMessage() + "; Elapsed Time - " + operationDuration.getDuration(TimeUnit.MILLISECONDS)); if (val.getStatusCode().equals(StatusCode.SUCCESS)) { getCounter(operationSuccessStr).increment(); } else { if (val.getStatusCode().equals(StatusCode.TIMEDOUT)) { final MemcachedNode node = getEVCacheNode(key); if(node instanceof EVCacheNodeImpl) { if (log.isInfoEnabled()) log.info(val.getStatusCode().name() + " Storing Key : " + key + "; Status : " + val.getStatusCode().name() + "; Node : " + node + "; Message : " + val.getMessage() + "; Elapsed Time - " + operationDuration.getDuration(TimeUnit.MILLISECONDS), new Exception()); if(node instanceof EVCacheNodeImpl) { getCounter(operationStr + "-" + val.getStatusCode().name(), ((EVCacheNodeImpl)node).getBaseTags()).increment(); } else { getCounter(operationStr + "-" + val.getStatusCode().name(), BasicTagList.of("HOST", node.getSocketAddress().toString())).increment(); } } } else { getCounter(operationStr + "-" + val.getStatusCode().name()).increment(); } } rv.set(val.isSuccess(), val); }
@Override public void receivedStatus(OperationStatus status) { operationDuration.stop(); rv.set(status.isSuccess(), status); if (status.getStatusCode().equals(StatusCode.SUCCESS)) { getCounter(TOUCH_OPERATION_STRING + "-SUCCESS").increment(); } else { if (status.getStatusCode().equals(StatusCode.TIMEDOUT)) { final MemcachedNode node = getEVCacheNode(key); if(node instanceof EVCacheNodeImpl) { getCounter(TOUCH_OPERATION_STRING + "-" + status.getStatusCode().name(), ((EVCacheNodeImpl)node).getBaseTags()).increment(); } else { getCounter(TOUCH_OPERATION_STRING + "-"+ status.getStatusCode().name(), BasicTagList.of("HOST", node.getSocketAddress().toString())).increment(); } } else { getCounter(TOUCH_OPERATION_STRING + "-"+ status.getStatusCode().name()).increment(); } } }
@Override public void receivedStatus(OperationStatus val) { rv.set(val.isSuccess(), val); } @Override
@Override public void receivedStatus(OperationStatus val) { rv.set(val.isSuccess(), val); } @Override
public void receivedStatus(OperationStatus s) { // XXX: Potential abstraction leak. // The handling of incr/decr in the binary protocol // Allows us to avoid string processing. rv.set(new Long(s.isSuccess()?s.getMessage():"-1")); } public void complete() {
@SuppressWarnings("synthetic-access") public void receivedStatus(OperationStatus status) { if(!status.isSuccess()) { getLogger().warn("Unsuccessful get: %s", status); } } public void gotData(String k, int flags, byte[] data) {
@Override public void receivedStatus(OperationStatus s) { // XXX: Potential abstraction leak. // The handling of incr/decr in the binary protocol // Allows us to avoid string processing. rv.set(new Long(s.isSuccess() ? s.getMessage() : "-1")); }
public void receivedStatus(OperationStatus s) { // XXX: Potential abstraction leak. // The handling of incr/decr in the binary protocol // Allows us to avoid string processing. rv.set(new Long(s.isSuccess() ? s.getMessage() : "-1")); }
@Override public void receivedStatus(OperationStatus s) { // XXX: Potential abstraction leak. // The handling of incr/decr in the binary protocol // Allows us to avoid string processing. rv.set(new Long(s.isSuccess() ? s.getMessage() : "-1")); }
@SuppressWarnings("synthetic-access") public void receivedStatus(OperationStatus status) { if(!status.isSuccess()) { getLogger().warn("Unsuccessful get: %s", status); } } public void gotData(String k, int flags, byte[] data) {
public void receivedStatus(OperationStatus s) { // XXX: Potential abstraction leak. // The handling of incr/decr in the binary protocol // Allows us to avoid string processing. rv.set(new Long(s.isSuccess()?s.getMessage():"-1")); } public void complete() {
@Override public void receivedStatus(OperationStatus status) { if(status.isSuccess()) { supportedMechs.set(status.getMessage()); getLogger().debug("Received SASL supported mechs: " + status.getMessage()); } else { getLogger().warn("Received non-success response for SASL mechs: " + status); } }
@Override public void receivedStatus(OperationStatus status) { if(status.isSuccess()) { supportedMechs.set(status.getMessage()); getLogger().debug("Received SASL supported mechs: " + status.getMessage()); } else { getLogger().warn("Received non-success response for SASL mechs: " + status); } }
@Override public void receivedStatus(OperationStatus status) { future.set(val, status); if (!replicaFuture.isDone() && (status.isSuccess() || status.getStatusCode() == StatusCode.ERR_NOT_FOUND)) { usedFuture = replicaFuture.setCompletedFuture(future); } }
@Override public void receivedStatus(OperationStatus status) { future.set(val, status); if (!replicaFuture.isDone() && (status.isSuccess() || status.getStatusCode() == StatusCode.ERR_NOT_FOUND)) { usedFuture = replicaFuture.setCompletedFuture(future); } }
@Override public void receivedStatus(OperationStatus status) { future.set(val, status); if (!replicaFuture.isDone() && (status.isSuccess() || status.getStatusCode() == StatusCode.ERR_NOT_FOUND)) { usedFuture = replicaFuture.setCompletedFuture(future); } }
@Override public void receivedStatus(OperationStatus status) { future.set(val, status); if (!replicaFuture.isDone() && (status.isSuccess() || status.getStatusCode() == StatusCode.ERR_NOT_FOUND)) { usedFuture = replicaFuture.setCompletedFuture(future); } }