/** * Deal with an operation where the channel reached the end of a stream. * * @param currentOp the current operation to read. * @param node the node for that operation. * @param rbuf the read buffer. * * @return the next operation on the node to read. * @throws IOException if disconnect while reading. */ private Operation handleReadsWhenChannelEndOfStream(final Operation currentOp, final MemcachedNode node, final ByteBuffer rbuf) throws IOException { if (currentOp instanceof TapOperation) { currentOp.getCallback().complete(); ((TapOperation) currentOp).streamClosed(OperationState.COMPLETE); getLogger().debug("Completed read op: %s and giving the next %d bytes", currentOp, rbuf.remaining()); Operation op = node.removeCurrentReadOp(); assert op == currentOp : "Expected to pop " + currentOp + " got " + op; return node.getCurrentReadOp(); } else { throw new IOException("Disconnected unexpected, will reconnect."); } }
/** * Deal with an operation where the channel reached the end of a stream. * * @param currentOp the current operation to read. * @param node the node for that operation. * @param rbuf the read buffer. * * @return the next operation on the node to read. * @throws IOException if disconnect while reading. */ private Operation handleReadsWhenChannelEndOfStream(final Operation currentOp, final MemcachedNode node, final ByteBuffer rbuf) throws IOException { if (currentOp instanceof TapOperation) { currentOp.getCallback().complete(); ((TapOperation) currentOp).streamClosed(OperationState.COMPLETE); getLogger().debug("Completed read op: %s and giving the next %d bytes", currentOp, rbuf.remaining()); Operation op = node.removeCurrentReadOp(); assert op == currentOp : "Expected to pop " + currentOp + " got " + op; return node.getCurrentReadOp(); } else { throw new IOException("Disconnected unexpected, will reconnect."); } }
if (currentOp instanceof TapOperation) { currentOp.getCallback().complete(); ((TapOperation) currentOp).streamClosed(OperationState.COMPLETE); getLogger().debug("Completed read op: %s and giving the next %d bytes",
for (String key : ((MultiGetOperationImpl) op).getRetryKeys()) { addOperation(key, opFact.get(key, (GetOperation.Callback) op.getCallback()));
for (String key : ((MultiGetOperationImpl) op).getRetryKeys()) { addOperation(key, opFact.get(key, (GetOperation.Callback) op.getCallback()));