Class PutDocumentMessage
- Author:
- Simon Thoresen Hult
-
Constructor Summary
ConstructorsConstructorDescriptionPutDocumentMessage(com.yahoo.document.DocumentPut put) Constructs a new document put messagePutDocumentMessage(LazyDecoder decoder, com.yahoo.document.serialization.DocumentDeserializer buffer) Constructs a new message from a byte buffer. -
Method Summary
Modifier and TypeMethodDescriptionstatic PutDocumentMessageCreates an empty PutDocumentMessageCreates and returns a reply to this message.intcom.yahoo.document.TestAndSetConditionbooleancom.yahoo.document.DocumentPutReturns the document put operationlongWhen a visitor client receives a Put as part of the visiting operation, this timestamp represents the wall clock time in microseconds(*) of the last known mutating operation to the document.longlongReturns the timestamp of the document to put.intgetType()booleanvoidsetCondition(com.yahoo.document.TestAndSetCondition condition) voidsetCreateIfNonExistent(boolean value) voidsetDocumentPut(com.yahoo.document.DocumentPut put) Sets the document to putvoidsetPersistedTimestamp(long time) Set the timestamp of the last known mutating operation to this document.voidsetTimestamp(long time) Sets the timestamp of the document to put.Methods inherited from class com.yahoo.documentapi.messagebus.protocol.DocumentMessage
getPriority, getProtocol, setPriority, swapStateMethods inherited from class com.yahoo.messagebus.Message
getBucketSequence, getRetry, getRetryEnabled, getRoute, getTimeReceived, getTimeRemaining, getTimeRemainingNow, hasBucketSequence, isExpired, setRetry, setRetryEnabled, setRoute, setTimeReceived, setTimeReceivedNow, setTimeRemainingMethods inherited from class com.yahoo.messagebus.Routable
discard, getCallStack, getContext, getTrace, popHandler, pushHandler, setContext
-
Constructor Details
-
PutDocumentMessage
public PutDocumentMessage(LazyDecoder decoder, com.yahoo.document.serialization.DocumentDeserializer buffer) Constructs a new message from a byte buffer.- Parameters:
decoder- The decoder to use for deserialization.buffer- A byte buffer that contains a serialized message.
-
PutDocumentMessage
public PutDocumentMessage(com.yahoo.document.DocumentPut put) Constructs a new document put message
-
-
Method Details
-
createEmpty
Creates an empty PutDocumentMessage -
getDocumentPut
public com.yahoo.document.DocumentPut getDocumentPut()Returns the document put operation -
setDocumentPut
public void setDocumentPut(com.yahoo.document.DocumentPut put) Sets the document to put -
getTimestamp
public long getTimestamp()Returns the timestamp of the document to put.
Only used by the feed pipeline; use
getPersistedTimestamp()to get the persisted backend timestamp of the document as observed by the client of a running visitor operation. -
setTimestamp
public void setTimestamp(long time) Sets the timestamp of the document to put.
Timestamp assignment should normally always be left to the content cluster, i.e. this method should not be called.
Only use this if you have a very specific use case and are aware of the downsides of side-stepping the internal timestamp mechanisms.
-
setPersistedTimestamp
public void setPersistedTimestamp(long time) Set the timestamp of the last known mutating operation to this document.
This is normally only invoked by the backends as part of visiting.
-
getPersistedTimestamp
public long getPersistedTimestamp()When a visitor client receives a Put as part of the visiting operation, this timestamp represents the wall clock time in microseconds(*) of the last known mutating operation to the document.
If zero, the sending content node is too old to support this feature.
This value is not guaranteed to be linearizable. During e.g. network partitions this value might not represent the latest acknowledged operation for the document.
Unsupported (and ignored) for Puts sent by the client during feeding.
(*) (wall clock seconds since UTC epoch * 1M) + synthetic intra-second microsecond counter.
-
createReply
Description copied from class:DocumentMessageCreates and returns a reply to this message.- Specified by:
createReplyin classDocumentMessage- Returns:
- The created reply.
-
getApproxSize
public int getApproxSize()- Overrides:
getApproxSizein classDocumentMessage
-
hasSequenceId
public boolean hasSequenceId()- Overrides:
hasSequenceIdin classcom.yahoo.messagebus.Message
-
getSequenceId
public long getSequenceId()- Overrides:
getSequenceIdin classcom.yahoo.messagebus.Message
-
getType
public int getType()- Specified by:
getTypein classcom.yahoo.messagebus.Routable
-
getCondition
public com.yahoo.document.TestAndSetCondition getCondition()- Specified by:
getConditionin classTestAndSetMessage
-
setCondition
public void setCondition(com.yahoo.document.TestAndSetCondition condition) - Specified by:
setConditionin classTestAndSetMessage
-
setCreateIfNonExistent
public void setCreateIfNonExistent(boolean value) -
getCreateIfNonExistent
public boolean getCreateIfNonExistent()
-