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) { if (val.getStatusCode().equals(StatusCode.SUCCESS)) { if (log.isDebugEnabled()) log.debug("AddOrAppend Key (Append Operation): " + key + "; Status : " + val.getStatusCode().name() + "; Message : " + val.getMessage() + "; Elapsed Time - " + (operationDuration.getDuration(TimeUnit.MILLISECONDS))); getCounter(AOA_APPEND_OPERATION_SUCCESS_STRING).increment(); rv.set(Boolean.TRUE, val); appendSuccess = true; } else { getCounter("AoA-AppendOperation-"+ val.getStatusCode().name()).increment(); } }
@Override @SuppressWarnings("synthetic-access") public void receivedStatus(OperationStatus status) { operationDuration.stop(); if (log.isDebugEnabled()) log.debug("GetBulk Keys : " + keys + "; Status : " + status.getStatusCode().name() + "; Message : " + status.getMessage() + "; Elapsed Time - " + operationDuration.getDuration(TimeUnit.MILLISECONDS)); if (status.getStatusCode().equals(StatusCode.SUCCESS)) { getCounter(BULK_OPERATION_STRING + "-SUCCESS").increment(); } else { getCounter(BULK_OPERATION_STRING + "-" + status.getStatusCode().name()).increment();//First lets get some data and then we can add Host info } rv.setStatus(status); }
@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); }
public void receivedStatus(OperationStatus status) { operationDuration .stop(); if (log.isDebugEnabled()) log.debug("Getting Key : " + key + "; Status : " + status.getStatusCode().name() + (log.isTraceEnabled() ? " Node : " + getEVCacheNode(key) : "") + "; Message : " + status.getMessage() + "; Elapsed Time - " + operationDuration.getDuration(TimeUnit.MILLISECONDS)); if (status.getStatusCode().equals(StatusCode.SUCCESS)) { getCounter(GET_OPERATION_STRING + "-SUCCESS").increment(); } else { if (status.getStatusCode().equals(StatusCode.TIMEDOUT)) { final MemcachedNode node = getEVCacheNode(key); if(node instanceof EVCacheNodeImpl) { getCounter(GET_OPERATION_STRING + "-" + status.getStatusCode().name(), ((EVCacheNodeImpl)node).getBaseTags()).increment(); } else { getCounter(GET_OPERATION_STRING + "-"+ status.getStatusCode().name(), BasicTagList.of("HOST", node.getSocketAddress().toString())).increment(); } } else { getCounter(GET_OPERATION_STRING + "-"+ status.getStatusCode().name()).increment(); } } try { if (val != null) { rv.set(val.get(), status); } else { rv.set(null, status); } } catch (Exception e) { log.error(e.getMessage(), e); rv.set(null, status); } }
public void receivedStatus(OperationStatus status) { operationDuration.stop(); if (log.isDebugEnabled()) log.debug("GetAndTouch Key : " + key + "; Status : " + status.getStatusCode().name() + (log.isTraceEnabled() ? " Node : " + getEVCacheNode(key) : "") + "; Message : " + status.getMessage() + "; Elapsed Time - " + operationDuration.getDuration(TimeUnit.MILLISECONDS)); if (status.getStatusCode().equals(StatusCode.SUCCESS)) { getCounter(GET_AND_TOUCH_OPERATION_STRING + "-SUCCESS").increment(); } else { if (status.getStatusCode().equals(StatusCode.TIMEDOUT)) { final MemcachedNode node = getEVCacheNode(key); if(node instanceof EVCacheNodeImpl) { getCounter(GET_AND_TOUCH_OPERATION_STRING + "-" + status.getStatusCode().name(), ((EVCacheNodeImpl)node).getBaseTags()).increment(); } else { getCounter(GET_AND_TOUCH_OPERATION_STRING + "-"+ status.getStatusCode().name(), BasicTagList.of("HOST", node.getSocketAddress().toString())).increment(); } } else { getCounter(GET_AND_TOUCH_OPERATION_STRING + "-"+ status.getStatusCode().name()).increment(); } } rv.set(val, status); }
@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")); } public void complete() {
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 @SuppressWarnings("synthetic-access") public void receivedStatus(OperationStatus status) { if (status.getStatusCode() == StatusCode.ERR_NOT_MY_VBUCKET) { pendingChunks.addAndGet(Integer.parseInt(status.getMessage())); } rv.setStatus(status); }
@Override public void receivedStatus(OperationStatus s) { rv.set(new Long(s.isSuccess() ? s.getMessage() : "-1"), s); }
@Override public void receivedStatus(OperationStatus val) { // If the status we found was null, we're done. if (val.getMessage().length() == 0) { done.set(true); node.authComplete(); getLogger().info("Authenticated to " + node.getSocketAddress()); } else { foundStatus.set(val); } }
@Override public void receivedStatus(OperationStatus val) { // If the status we found was null, we're done. if (val.getMessage().length() == 0) { done.set(true); node.authComplete(); getLogger().info("Authenticated to " + node.getSocketAddress()); } else { foundStatus.set(val); } }
public void receivedStatus(OperationStatus val) { // If the status we found was null, we're done. if(val.getMessage().length() == 0) { done.set(true); node.authComplete(); getLogger().info("Authenticated to " + node.getSocketAddress()); } else { foundStatus.set(val); } }
public void receivedStatus(OperationStatus val) { // If the status we found was null, we're done. if (val.getMessage().length() == 0) { done.set(true); node.authComplete(); getLogger().info("Authenticated to " + node.getSocketAddress()); } else { foundStatus.set(val); } }
private Operation buildOperation(OperationStatus st, OperationCallback cb) { if (st == null) { return opFact.saslAuth(authDescriptor.mechs, node.getSocketAddress().toString(), null, authDescriptor.cbh, cb); } else { return opFact.saslStep(authDescriptor.mechs, KeyUtil.getKeyBytes(st.getMessage()), node.getSocketAddress().toString(), null, authDescriptor.cbh, cb); } } }
private Operation buildOperation(OperationStatus st, OperationCallback cb, final String [] supportedMechs) { if (st == null) { return opFact.saslAuth(supportedMechs, node.getSocketAddress().toString(), null, authDescriptor.getCallback(), cb); } else { return opFact.saslStep(supportedMechs, KeyUtil.getKeyBytes( st.getMessage()), node.getSocketAddress().toString(), null, authDescriptor.getCallback(), cb); } } }