public interface IStoreCommitCompletionEvent extends IStoreEvent
Modifier and Type | Method and Description |
---|---|
IStoreCommitCompletionEvent |
complete(boolean sync)
Set commit as complete.
|
IStoreCommitCompletionStatus |
getCompletionStatus()
Get the commit completion status
|
boolean |
getDispatch()
Get whether completion dispatch has been switched on.
|
boolean |
getNotify()
Get whether completion notification has been switched on.
|
long |
getPostWireTs()
Get the commit post-wire time.
|
long |
getPreWireTs()
Get the commit pre-wire time.
|
long |
getStableTransactionId()
Gets the stable transaction id associated with the store commit completion.
|
long |
getStartTs()
Get the commit start time.
|
long |
getTransactionId()
Gets the transaction id associated with the store commit completion.
|
boolean |
isComplete()
Get whether the commit operation has completed.
|
IStoreCommitCompletionEvent |
setDispatch(boolean val)
Set whether the completion event should be dispatched to the user event
handler.
|
IStoreCommitCompletionEvent |
setNotify(boolean val)
Set whether the user should be notified on commit completion.
|
void |
setPostWireTs(long ts)
Set the commit post-wire time.
|
void |
setPreWireTs(long ts)
Set the commit pre-wire time.
|
void |
setStableTransactionId(long stableTransactionId)
Sets the stable transaction id associated with the commit.
|
void |
setStartTs(long ts)
Set the commit start time.
|
void |
setTransactionId(long transactionId)
Sets the transaction id associated with the commit.
|
void |
waitForCompletion()
Wait for completion of the commit.
|
boolean |
wasSyncComplete()
Get whether the commit operation completed synchronously.
|
getSource
acquire, dispose, getAcknowledger, getAttachment, getDelay, getDispatchTime, getInstanceNumber, getRemainingTime, getScheduledTime, getType, isEndOfBatch, isHandled, owners, setAcknowledger, setAttachment, setDelay, setEndOfBatch, setHandled, setSource
referenceTracker
IStoreCommitCompletionEvent setNotify(boolean val)
val
- Specify true for notification to be switched on and false
for notification to be switched off.
By default, upon completion of the commit operation, the completion
event is dispatched to the user through its registered event handler.
The user can use this method to request to be additionally notified of
the completion. The notification mechanism enables the user to block
and wait for commit completion. To block and wait, the user should
invoke this indicating interest in being notified and then invoke
waitForCompletion()
to wait for the commit to complete. When
the commit completes, the threads blocked in waitForCompletion()
will be woken up.
The default behavior is for completion notification to be switched off
and completion dispatch to be switched on. Enabling or disabling
completion notifications does not affect completion dispatch behavior.
That is controlled by setDispatch(boolean)
boolean getNotify()
IStoreCommitCompletionEvent setDispatch(boolean val)
val
- Specify true for dispatch to be switched on and false
for dispatch to be switched off.By default, upon completion of the commit operation, the completion event is dispatched to the user through its registered event handler. The user can use this method to block the dispatch of the event to the event handler.
The default behavior is for completion notification to be switched off
and completion dispatch to be switched on. Enabling or disabling
dispatch notifications does not affect completion notification behavior.
That is controlled by setNotify(boolean)
boolean getDispatch()
IStoreCommitCompletionEvent complete(boolean sync)
Note: This method should not be invoked by the user. It is intended for use by the ODS runtime to mark a commit as complete.
void waitForCompletion() throws InterruptedException
InterruptedException
The user should invoke this method to wait for the completion of
the commit operation associated with this event. Thread waiting
on this call are woken up when the commit operation completes (if
the user has switched on completion notification via setNotify(boolean)
)
Threads invoking this method after completion of the commit will
return immediately irrespective of whether completion notification
is switched on or not.
boolean isComplete()
This method polls for whether the commit operation has completed.
boolean wasSyncComplete()
IStoreCommitCompletionStatus getCompletionStatus()
This method returns the completion status of a commit operation. The
method returns null if and only if the commit has not yet completed
i.e. if and only if isComplete()
returns false.
void setStartTs(long ts)
long getStartTs()
void setPreWireTs(long ts)
The pre-wire time is the time at which the last entry in the commit's commit queue was serialized into a network buffer.
long getPreWireTs()
void setPostWireTs(long ts)
The post-wire time is the time at which the ack for the commit was deserialized from the network buffer
long getPostWireTs()
void setTransactionId(long transactionId)
transactionId
- the committed transaction.long getTransactionId()
void setStableTransactionId(long stableTransactionId)
stableTransactionId
- the stable transaction id.getStableTransactionId()
long getStableTransactionId()
When the store is used as part of a transaction pipeline in which message sends are stablized after a store commit, the stable transaction records the transaction id that has been stabliized downstream.
The store uses the stable transaction id during log compaction to determine which outbound message can be discarded when operating with an HaPolicy of StateReplication
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.