@Override protected void finishedPayload(byte[] pl) throws IOException { if (responseOpaque == terminalOpaque) { getCallback().receivedStatus(STATUS_OK); transitionState(OperationState.COMPLETE); } else if (errorCode != 0) { getLogger().warn("Error on key %s: %s (%d)", keys.get(responseOpaque), new String(pl), errorCode); } else { final int flags = decodeInt(pl, 0); final byte[] data = new byte[pl.length - EXTRA_HDR_LEN]; System.arraycopy(pl, EXTRA_HDR_LEN, data, 0, pl.length - EXTRA_HDR_LEN); Callback cb = (Callback) getCallback(); cb.gotData(keys.get(responseOpaque), flags, data); } resetInput(); }
@Override protected void finishedPayload(byte[] pl) throws IOException { if (responseOpaque == terminalOpaque) { getCallback().receivedStatus(STATUS_OK); transitionState(OperationState.COMPLETE); } else if (errorCode != 0) { getLogger().warn("Error on key %s: %s (%d)", keys.get(responseOpaque), new String(pl), errorCode); } else { final int flags = decodeInt(pl, 0); final byte[] data = new byte[pl.length - EXTRA_HDR_LEN]; System.arraycopy(pl, EXTRA_HDR_LEN, data, 0, pl.length - EXTRA_HDR_LEN); Callback cb = (Callback) getCallback(); cb.gotData(keys.get(responseOpaque), flags, data); } resetInput(); }
@Override protected void finishedPayload(byte[] pl) throws IOException { getStatusForErrorCode(errorCode, pl); if (responseOpaque == terminalOpaque) { if (retryKeys.size() > 0) { transitionState(OperationState.RETRY); OperationStatus retryStatus = new OperationStatus(true, Integer.toString(retryKeys.size()), StatusCode.ERR_NOT_MY_VBUCKET); getCallback().receivedStatus(retryStatus); getCallback().complete(); } else { getCallback().receivedStatus(STATUS_OK); transitionState(OperationState.COMPLETE); } } else if (errorCode == ERR_NOT_MY_VBUCKET) { retryKeys.add(keys.get(responseOpaque)); } else if (errorCode != SUCCESS) { getLogger().warn("Error on key %s: %s (%d)", keys.get(responseOpaque), new String(pl), errorCode); } else { final int flags = decodeInt(pl, 0); final byte[] data = new byte[pl.length - EXTRA_HDR_LEN]; System.arraycopy(pl, EXTRA_HDR_LEN, data, 0, pl.length - EXTRA_HDR_LEN); Callback cb = (Callback) getCallback(); cb.gotData(keys.get(responseOpaque), flags, data); } resetInput(); }
@Override protected void finishedPayload(byte[] pl) throws IOException { if(responseOpaque == terminalOpaque) { getCallback().receivedStatus(STATUS_OK); transitionState(OperationState.COMPLETE); } else if(errorCode != 0) { getLogger().warn("Error on key %s: %s (%d)", keys.get(responseOpaque), new String(pl), errorCode); } else { final int flags=decodeInt(pl, 0); final byte[] data=new byte[pl.length - EXTRA_HDR_LEN]; System.arraycopy(pl, EXTRA_HDR_LEN, data, 0, pl.length-EXTRA_HDR_LEN); Callback cb=(Callback)getCallback(); cb.gotData(keys.get(responseOpaque), flags, data); } resetInput(); }
@Override protected void finishedPayload(byte[] pl) throws IOException { if(responseOpaque == terminalOpaque) { getCallback().receivedStatus(STATUS_OK); transitionState(OperationState.COMPLETE); } else if(errorCode != 0) { getLogger().warn("Error on key %s: %s (%d)", keys.get(responseOpaque), new String(pl), errorCode); } else { final int flags=decodeInt(pl, 0); final byte[] data=new byte[pl.length - EXTRA_HDR_LEN]; System.arraycopy(pl, EXTRA_HDR_LEN, data, 0, pl.length-EXTRA_HDR_LEN); Callback cb=(Callback)getCallback(); cb.gotData(keys.get(responseOpaque), flags, data); } resetInput(); }
@Override protected void finishedPayload(byte[] pl) throws IOException { getStatusForErrorCode(errorCode, pl); if (responseOpaque == terminalOpaque) { if (retryKeys.size() > 0) { transitionState(OperationState.RETRY); OperationStatus retryStatus = new OperationStatus(true, Integer.toString(retryKeys.size()), StatusCode.ERR_NOT_MY_VBUCKET); getCallback().receivedStatus(retryStatus); getCallback().complete(); } else { getCallback().receivedStatus(STATUS_OK); transitionState(OperationState.COMPLETE); } } else if (errorCode == ERR_NOT_MY_VBUCKET) { retryKeys.add(keys.get(responseOpaque)); } else if (errorCode != SUCCESS) { getLogger().warn("Error on key %s: %s (%d)", keys.get(responseOpaque), new String(pl), errorCode); } else { final int flags = decodeInt(pl, 0); final byte[] data = new byte[pl.length - EXTRA_HDR_LEN]; System.arraycopy(pl, EXTRA_HDR_LEN, data, 0, pl.length - EXTRA_HDR_LEN); Callback cb = (Callback) getCallback(); cb.gotData(keys.get(responseOpaque), flags, data); } resetInput(); }