com.neeve.ods
Interface IStoreCommitCompletionEvent

All Superinterfaces:
IEvent, IStoreEvent, UtlReferenceTracker.HasReferenceTracker

public interface IStoreCommitCompletionEvent
extends IStoreEvent

Represents the event notifying the completion of a commit operation.

Threading:
This class is safe for concurrent access by multiple threads.

Method Summary
 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 getStartTs()
          Get the commit start time.
 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 setStartTs(long ts)
          Set the commit start time.
 void waitForCompletion()
          Wait for completion of the commit.
 boolean wasSyncComplete()
          Get whether the commit operation completed synchronously.
 
Methods inherited from interface com.neeve.ods.IStoreEvent
getSource
 
Methods inherited from interface com.neeve.event.IEvent
acquire, dispose, getAcknowledger, getAttachment, getDelay, getDispatchTime, getInstanceNumber, getRemainingTime, getScheduledTime, getType, isEndOfBatch, isHandled, owners, setAcknowledger, setAttachment, setDelay, setEndOfBatch, setHandled, setSource
 
Methods inherited from interface com.neeve.util.UtlReferenceTracker.HasReferenceTracker
referenceTracker
 

Method Detail

setNotify

IStoreCommitCompletionEvent setNotify(boolean val)
Set whether the user should be notified on commit completion.

Parameters:
val - Specify true for notification to be switched on and false for notification to be switched off.
Threading:
This method is safe for concurrent access by multiple threads.

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)


getNotify

boolean getNotify()
Get whether completion notification has been switched on.

Threading:
This method is safe for concurrent access by multiple threads.

setDispatch

IStoreCommitCompletionEvent setDispatch(boolean val)
Set whether the completion event should be dispatched to the user event handler.

Parameters:
val - Specify true for dispatch to be switched on and false for dispatch to be switched off.
Threading:
This method is safe for concurrent access by multiple threads.

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)


getDispatch

boolean getDispatch()
Get whether completion dispatch has been switched on.

Threading:
This method is safe for concurrent access by multiple threads.

complete

IStoreCommitCompletionEvent complete(boolean sync)
Set commit as complete.

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.


waitForCompletion

void waitForCompletion()
                       throws InterruptedException
Wait for completion of the commit.

Throws:
InterruptedException
Threading:
This method is safe for concurrent access by multiple threads.

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.


isComplete

boolean isComplete()
Get whether the commit operation has completed.

Threading:
This method is safe for concurrent access by multiple threads.

This method polls for whether the commit operation has completed.


wasSyncComplete

boolean wasSyncComplete()
Get whether the commit operation completed synchronously.

Threading:
This method is safe for concurrent access by multiple threads.

getCompletionStatus

IStoreCommitCompletionStatus getCompletionStatus()
Get the commit completion status

Returns:
Returns the completion status or null if the commit has not yet completed.

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.


setStartTs

void setStartTs(long ts)
Set the commit start time.


getStartTs

long getStartTs()
Get the commit start time.


setPreWireTs

void setPreWireTs(long ts)
Set the commit pre-wire time.

The pre-wire time is the time at which the last entry in the commit's commit queue was serialized into a network buffer.


getPreWireTs

long getPreWireTs()
Get the commit pre-wire time.


setPostWireTs

void setPostWireTs(long ts)
Set the commit post-wire time.

The post-wire time is the time at which the ack for the commit was deserialized from the network buffer


getPostWireTs

long getPostWireTs()
Get the commit post-wire time.



Copyright © 2016 Neeve Research, LLC. All Rights Reserved.