public class ReplicaGetOperationImpl extends BaseOperationImpl implements ReplicaGetOperation
ReplicaGetOperation.Callback
Modifier and Type | Field and Description |
---|---|
protected static byte |
DUMMY_OPCODE |
protected static byte[] |
EMPTY_BYTES |
protected static int |
ERR_2BIG |
protected static int |
ERR_BUSY |
protected static int |
ERR_DELTA_BADVAL |
protected static int |
ERR_EXISTS |
protected static int |
ERR_INTERNAL |
protected static int |
ERR_INVAL |
protected static int |
ERR_NO_MEM |
protected static int |
ERR_NOT_FOUND |
protected static int |
ERR_NOT_MY_VBUCKET |
protected static int |
ERR_NOT_STORED |
protected static int |
ERR_NOT_SUPPORTED |
protected static int |
ERR_TEMP_FAIL |
protected static int |
ERR_UNKNOWN_COMMAND |
protected int |
errorCode |
protected java.lang.String |
key |
protected int |
keyLen |
protected static int |
MIN_RECV_PACKET |
protected int |
opaque |
protected static byte |
REQ_MAGIC |
protected static byte |
RES_MAGIC |
protected long |
responseCas |
protected byte |
responseCmd |
protected int |
responseOpaque |
protected static OperationStatus |
STATUS_OK |
protected static int |
SUCCESS
Error code for operations.
|
protected short |
vbucket |
callback, CANCELLED, notMyVbucketNodes, TIMED_OUT
Constructor and Description |
---|
ReplicaGetOperationImpl(java.lang.String k,
int index,
ReplicaGetOperation.Callback cb) |
Modifier and Type | Method and Description |
---|---|
void |
addNotMyVbucketNode(MemcachedNode node) |
protected void |
decodePayload(byte[] pl)
Decode the given payload for this command.
|
protected void |
finishedPayload(byte[] pl) |
java.util.Collection<java.lang.String> |
getKeys()
Get the keys requested in this GetOperation.
|
java.util.Collection<MemcachedNode> |
getNotMyVbucketNodes() |
int |
getReplicaIndex() |
protected OperationStatus |
getStatusForErrorCode(int errCode,
byte[] errPl)
Get the OperationStatus object for the given error code.
|
short |
getVBucket(java.lang.String k) |
void |
initialize()
Initialize this operation.
|
protected boolean |
opaqueIsValid()
Validate an opaque value from the header.
|
protected void |
prepareBuffer(java.lang.String key,
long cas,
byte[] val,
java.lang.Object... extraHeaders)
Prepare a send buffer.
|
void |
readFromBuffer(java.nio.ByteBuffer b)
Read data from the given byte buffer and dispatch to the appropriate read
mechanism.
|
protected void |
resetInput() |
void |
setNotMyVbucketNodes(java.util.Collection<MemcachedNode> nodes) |
void |
setVBucket(java.lang.String k,
short vb) |
java.lang.String |
toString() |
cancel, getBuffer, getCallback, getException, getHandlingNode, getState, handleError, handleRead, hasErrored, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, setBuffer, setCallback, setHandlingNode, timeOut, transitionState, wasCancelled, writeComplete, writing
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getKeys
cancel, getBuffer, getCallback, getException, getHandlingNode, getState, handleRead, hasErrored, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, readFromBuffer, setHandlingNode, timeOut, writeComplete, writing
protected final java.lang.String key
protected static final byte REQ_MAGIC
protected static final byte RES_MAGIC
protected static final byte DUMMY_OPCODE
protected static final int MIN_RECV_PACKET
protected static final int SUCCESS
protected static final int ERR_NOT_FOUND
protected static final int ERR_EXISTS
protected static final int ERR_2BIG
protected static final int ERR_INVAL
protected static final int ERR_NOT_STORED
protected static final int ERR_DELTA_BADVAL
protected static final int ERR_NOT_MY_VBUCKET
protected static final int ERR_UNKNOWN_COMMAND
protected static final int ERR_NO_MEM
protected static final int ERR_NOT_SUPPORTED
protected static final int ERR_INTERNAL
protected static final int ERR_BUSY
protected static final int ERR_TEMP_FAIL
protected static final byte[] EMPTY_BYTES
protected static final OperationStatus STATUS_OK
protected short vbucket
protected final int opaque
protected int keyLen
protected byte responseCmd
protected int errorCode
protected int responseOpaque
protected long responseCas
public ReplicaGetOperationImpl(java.lang.String k, int index, ReplicaGetOperation.Callback cb)
public void initialize()
Operation
initialize
in interface Operation
initialize
in class BaseOperationImpl
protected void decodePayload(byte[] pl)
pl
- the payload.public int getReplicaIndex()
getReplicaIndex
in interface ReplicaGetOperation
public java.util.Collection<java.lang.String> getKeys()
KeyedOperation
getKeys
in interface KeyedOperation
public java.util.Collection<MemcachedNode> getNotMyVbucketNodes()
getNotMyVbucketNodes
in interface VBucketAware
public void addNotMyVbucketNode(MemcachedNode node)
addNotMyVbucketNode
in interface VBucketAware
public void setNotMyVbucketNodes(java.util.Collection<MemcachedNode> nodes)
setNotMyVbucketNodes
in interface VBucketAware
public void setVBucket(java.lang.String k, short vb)
setVBucket
in interface VBucketAware
public short getVBucket(java.lang.String k)
getVBucket
in interface VBucketAware
public java.lang.String toString()
protected void resetInput()
public void readFromBuffer(java.nio.ByteBuffer b) throws java.io.IOException
Operation
readFromBuffer
in interface Operation
readFromBuffer
in class BaseOperationImpl
java.io.IOException
protected void finishedPayload(byte[] pl) throws java.io.IOException
java.io.IOException
protected OperationStatus getStatusForErrorCode(int errCode, byte[] errPl) throws java.io.IOException
errCode
- the error codejava.io.IOException
protected boolean opaqueIsValid()
protected void prepareBuffer(java.lang.String key, long cas, byte[] val, java.lang.Object... extraHeaders)
key
- the key (for keyed ops)cas
- the cas valueval
- the data payloadextraHeaders
- any additional headers that need to be sentCopyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.