Package net.spy.memcached.protocol.ascii
Class MutatorOperationImpl
- java.lang.Object
-
- net.spy.memcached.compat.SpyObject
-
- net.spy.memcached.protocol.BaseOperationImpl
-
- net.spy.memcached.protocol.ascii.OperationImpl
-
- net.spy.memcached.protocol.ascii.MutatorOperationImpl
-
- All Implemented Interfaces:
KeyedOperation,MutatorOperation,Operation
final class MutatorOperationImpl extends OperationImpl implements MutatorOperation
Operation for mutating integers inside of memcached.
-
-
Field Summary
Fields Modifier and Type Field Description private longamountprivate java.lang.Stringkeyprivate Mutatormutatorprivate static OperationStatusNOT_FOUNDstatic intOVERHEAD-
Fields inherited from class net.spy.memcached.protocol.ascii.OperationImpl
CRLF
-
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 amt, OperationCallback c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetBy()Get the amount we're mutating by.longgetDefault()Get the default value (for when there's no value to mutate).intgetExpiration()Get the expiration to set in case of a new entry.java.util.Collection<java.lang.String>getKeys()Get the keys requested in this GetOperation.MutatorgetType()Get the mutator type used for this operation.voidhandleLine(java.lang.String line)voidinitialize()Initialize this operation.java.lang.StringtoString()protected voidwasCancelled()This is called on each subclass whenever an operation was cancelled.-
Methods inherited from class net.spy.memcached.protocol.ascii.OperationImpl
classifyError, getErrorMsg, getReadType, matchStatus, readFromBuffer, setArguments, setReadType
-
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, 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.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
-
OVERHEAD
public static final int OVERHEAD
- See Also:
- Constant Field Values
-
NOT_FOUND
private static final OperationStatus NOT_FOUND
-
mutator
private final Mutator mutator
-
key
private final java.lang.String key
-
amount
private final long amount
-
-
Constructor Detail
-
MutatorOperationImpl
public MutatorOperationImpl(Mutator m, java.lang.String k, long amt, OperationCallback c)
-
-
Method Detail
-
handleLine
public void handleLine(java.lang.String line)
- Specified by:
handleLinein classOperationImpl
-
initialize
public void initialize()
Description copied from interface:OperationInitialize this operation. This is used to prepare output byte buffers and stuff.- Specified by:
initializein interfaceOperation- Specified by:
initializein classBaseOperationImpl
-
wasCancelled
protected void wasCancelled()
Description copied from class:BaseOperationImplThis is called on each subclass whenever an operation was cancelled.- Overrides:
wasCancelledin classBaseOperationImpl
-
getKeys
public java.util.Collection<java.lang.String> getKeys()
Description copied from interface:KeyedOperationGet the keys requested in this GetOperation.- Specified by:
getKeysin interfaceKeyedOperation
-
getBy
public long getBy()
Description copied from interface:MutatorOperationGet the amount we're mutating by.- Specified by:
getByin interfaceMutatorOperation
-
getDefault
public long getDefault()
Description copied from interface:MutatorOperationGet the default value (for when there's no value to mutate).- Specified by:
getDefaultin interfaceMutatorOperation
-
getExpiration
public int getExpiration()
Description copied from interface:MutatorOperationGet the expiration to set in case of a new entry.- Specified by:
getExpirationin interfaceMutatorOperation
-
getType
public Mutator getType()
Description copied from interface:MutatorOperationGet the mutator type used for this operation.- Specified by:
getTypein interfaceMutatorOperation
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-