Class MutatorOperationImpl
- java.lang.Object
-
- net.spy.memcached.compat.SpyObject
-
- net.spy.memcached.protocol.BaseOperationImpl
-
- net.spy.memcached.protocol.binary.OperationImpl
-
- net.spy.memcached.protocol.binary.SingleKeyOperationImpl
-
- net.spy.memcached.protocol.binary.MutatorOperationImpl
-
- All Implemented Interfaces:
KeyedOperation
,MutatorOperation
,Operation
,VBucketAware
class MutatorOperationImpl extends SingleKeyOperationImpl implements MutatorOperation
-
-
Field Summary
Fields Modifier and Type Field Description private long
by
private static byte
CMD_DECR
private static byte
CMD_INCR
private long
def
private int
exp
private Mutator
mutator
-
Fields inherited from class net.spy.memcached.protocol.binary.SingleKeyOperationImpl
key
-
Fields inherited from class net.spy.memcached.protocol.binary.OperationImpl
DUMMY_OPCODE, EMPTY_BYTES, ERR_2BIG, ERR_BUSY, ERR_DELTA_BADVAL, ERR_EXISTS, ERR_INTERNAL, ERR_INVAL, ERR_NO_MEM, ERR_NOT_FOUND, ERR_NOT_MY_VBUCKET, ERR_NOT_STORED, ERR_NOT_SUPPORTED, ERR_TEMP_FAIL, ERR_UNKNOWN_COMMAND, errorCode, keyLen, MIN_RECV_PACKET, opaque, REQ_MAGIC, RES_MAGIC, responseCas, responseCmd, responseOpaque, STATUS_OK, SUCCESS, vbucket
-
Fields inherited from class net.spy.memcached.protocol.BaseOperationImpl
callback, CANCELLED, notMyVbucketNodes, TIMED_OUT
-
-
Constructor Summary
Constructors Constructor Description MutatorOperationImpl(Mutator m, java.lang.String k, long b, long d, int e, OperationCallback cb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
decodePayload(byte[] pl)
Decode the given payload for this command.long
getBy()
Get the amount we're mutating by.long
getDefault()
Get the default value (for when there's no value to mutate).int
getExpiration()
Get the expiration to set in case of a new entry.Mutator
getType()
Get the mutator type used for this operation.void
initialize()
Initialize this operation.java.lang.String
toString()
-
Methods inherited from class net.spy.memcached.protocol.binary.SingleKeyOperationImpl
addNotMyVbucketNode, getKeys, getNotMyVbucketNodes, getVBucket, setNotMyVbucketNodes, setVBucket
-
Methods inherited from class net.spy.memcached.protocol.binary.OperationImpl
decodeByte, decodeInt, decodeLong, decodeShort, decodeUnsignedInt, finishedPayload, generateOpaque, getErrorMsg, getStatusForErrorCode, opaqueIsValid, prepareBuffer, readFromBuffer, resetInput
-
Methods inherited from class net.spy.memcached.protocol.BaseOperationImpl
addClone, cancel, getBuffer, getCallback, getCloneCount, getException, getHandlingNode, getState, getWriteCompleteTimestamp, handleError, handleRead, hasErrored, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, setBuffer, setCallback, setCloneCount, setHandlingNode, timeOut, transitionState, wasCancelled, writeComplete, writing
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.spy.memcached.ops.KeyedOperation
getKeys
-
Methods inherited from interface net.spy.memcached.ops.Operation
addClone, cancel, getBuffer, getCallback, getCloneCount, getErrorMsg, getException, getHandlingNode, getState, getWriteCompleteTimestamp, handleRead, hasErrored, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, readFromBuffer, setCloneCount, setHandlingNode, timeOut, writeComplete, writing
-
-
-
-
Field Detail
-
CMD_INCR
private static final byte CMD_INCR
- See Also:
- Constant Field Values
-
CMD_DECR
private static final byte CMD_DECR
- See Also:
- Constant Field Values
-
mutator
private final Mutator mutator
-
by
private final long by
-
exp
private final int exp
-
def
private final long def
-
-
Constructor Detail
-
MutatorOperationImpl
public MutatorOperationImpl(Mutator m, java.lang.String k, long b, long d, int e, OperationCallback cb)
-
-
Method Detail
-
initialize
public void initialize()
Description copied from interface:Operation
Initialize this operation. This is used to prepare output byte buffers and stuff.- Specified by:
initialize
in interfaceOperation
- Specified by:
initialize
in classBaseOperationImpl
-
decodePayload
protected void decodePayload(byte[] pl)
Description copied from class:OperationImpl
Decode the given payload for this command.- Overrides:
decodePayload
in classOperationImpl
- Parameters:
pl
- the payload.
-
getBy
public long getBy()
Description copied from interface:MutatorOperation
Get the amount we're mutating by.- Specified by:
getBy
in interfaceMutatorOperation
-
getDefault
public long getDefault()
Description copied from interface:MutatorOperation
Get the default value (for when there's no value to mutate).- Specified by:
getDefault
in interfaceMutatorOperation
-
getExpiration
public int getExpiration()
Description copied from interface:MutatorOperation
Get the expiration to set in case of a new entry.- Specified by:
getExpiration
in interfaceMutatorOperation
-
getType
public Mutator getType()
Description copied from interface:MutatorOperation
Get the mutator type used for this operation.- Specified by:
getType
in interfaceMutatorOperation
-
toString
public java.lang.String toString()
- Overrides:
toString
in classSingleKeyOperationImpl
-
-