public interface Operation
Modifier and Type | Method and Description |
---|---|
void |
addClone(Operation op)
Add the clone from this operation.
|
void |
cancel()
Cancel this operation.
|
java.nio.ByteBuffer |
getBuffer()
Get the write buffer for this operation.
|
OperationCallback |
getCallback()
Get the callback for this get operation.
|
int |
getCloneCount()
Returns the number of times this operation has been cloned.
|
byte[] |
getErrorMsg()
Returns the raw bytes of the error message content.
|
OperationException |
getException()
Get the exception that occurred (or null if no exception occurred).
|
MemcachedNode |
getHandlingNode()
Get the node that should've been handling this operation.
|
OperationState |
getState()
Get the current state of this operation.
|
long |
getWriteCompleteTimestamp()
Returns the timestamp from the point where the WRITE was completed.
|
void |
handleRead(java.nio.ByteBuffer data)
Handle a raw data read.
|
boolean |
hasErrored()
True if an error occurred while processing this operation.
|
void |
initialize()
Initialize this operation.
|
boolean |
isCancelled()
Has this operation been cancelled?
|
boolean |
isTimedOut()
True if the operation has timed out.
|
boolean |
isTimedOut(long ttlMillis)
True if the operation has timed out.
|
boolean |
isTimedOutUnsent()
True if the operation has timed out and has not been sent.
|
void |
readFromBuffer(java.nio.ByteBuffer data)
Read data from the given byte buffer and dispatch to the appropriate read
mechanism.
|
void |
setCloneCount(int count)
Sets the clone count for this operation.
|
void |
setHandlingNode(MemcachedNode to)
Set a reference to the node that will be/is handling this operation.
|
void |
timeOut()
Mark this operation as one which has exceeded its timeout value.
|
void |
writeComplete()
Invoked after having written all of the bytes from the supplied output
buffer.
|
void |
writing()
Invoked when we start writing all of the bytes from this operation to
the sockets write buffer.
|
boolean isCancelled()
boolean hasErrored()
OperationException getException()
OperationCallback getCallback()
void cancel()
OperationState getState()
java.nio.ByteBuffer getBuffer()
void writing()
void writeComplete()
void initialize()
void readFromBuffer(java.nio.ByteBuffer data) throws java.io.IOException
java.io.IOException
void handleRead(java.nio.ByteBuffer data)
MemcachedNode getHandlingNode()
void setHandlingNode(MemcachedNode to)
to
- a memcached nodevoid timeOut()
boolean isTimedOut()
A timed out operation may or may not have been sent to the server already, but it exceeded either the specified or the default timeout value.
boolean isTimedOut(long ttlMillis)
A timed out operation may or may not have been sent to the server already, but it exceeded either the specified or the default timeout value.
In the rare case this may be called with a longer timeout value after having been called with a shorter value that caused the operation to be timed out, an IllegalArgumentException may be thrown.
ttlMillis
- the max amount of time an operation may have existed since
its creation in milliseconds.boolean isTimedOutUnsent()
long getWriteCompleteTimestamp()
byte[] getErrorMsg()
void addClone(Operation op)
op
- the cloned operation.int getCloneCount()
void setCloneCount(int count)
Copyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.