com.neeve.rog
Interface IRogChangeDataCaptureHandler


public interface IRogChangeDataCaptureHandler

Defines the interface for a change data capture handler.

The platform delivers CDC updates based on IStorePersister checkpoints. The IStoreBinding periodically demarcates checkpoints in its stream of PUT, UPDATE and REMOVE operations. Objects that are mutated after such a checkpoint demarcation are tagged with a checkpoint version indicating the checkpoint in which they were last modified.

Checkpoints in a log are used to perform change data capture. The CDC Processor walks the log and dispatches change events for each stable checkpoint in the log. A stable checkpoint is defined as a checkpoint that is complete and all transactions in the checkpoint have been stabililized. The CDC processor records change events successfully processed by the CDC handler and does not dispatch already processed entries upon restart of the CDC process.


Nested Class Summary
static class IRogChangeDataCaptureHandler.ChangeType
          Enumerates the various types of change for an object that can be reported by the CDC processor
static class IRogChangeDataCaptureHandler.LogCompletionReason
          Enumerates the set of reasons why CDC run on a log completed
 
Method Summary
 boolean handleChange(com.eaio.uuid.UUID objectId, IRogChangeDataCaptureHandler.ChangeType changeType, List<IRogNode> entries)
          Called to notify of a change.
 boolean onCheckpointComplete(long checkpointVersion)
          Dispatched when the processing of a checkpoint has completed started
 void onCheckpointStart(long checkpointVersion)
          Dispatched when the processing of a new checkpoint is started
 void onLogComplete(int logNumber, IRogChangeDataCaptureHandler.LogCompletionReason reason, Throwable errorCause)
          Dispatched when the CDC has reached the end of the current log.
 void onLogStart(int logNumber)
          Dispatched when the processing of a new log is started
 void onWait()
          Dispatched when waiting for more entries to enter the log being CDC'd This event is dispatched once each time the reader reaches the end of the log being CDC'd and it waits for a new entry to be added to the log.
 

Method Detail

onLogStart

void onLogStart(int logNumber)
Dispatched when the processing of a new log is started

Parameters:
logNumber - The log number

onCheckpointStart

void onCheckpointStart(long checkpointVersion)
Dispatched when the processing of a new checkpoint is started

Parameters:
checkpointVersion - The checkpoint number

handleChange

boolean handleChange(com.eaio.uuid.UUID objectId,
                     IRogChangeDataCaptureHandler.ChangeType changeType,
                     List<IRogNode> entries)
Called to notify of a change.

Parameters:
objectId - The id of the object.
changeType - The change being reported
entries - The set of entries that list the operations performed on the object within the checkpoint being processed.
Returns:
A return value of true will cause the data change propagator to mark the change as handled. A best effort attempt will then be made not to resubmit the change in an event of a failure mid processing, but the handler must be prepared to handle duplicate changes in the event of a failure.

onCheckpointComplete

boolean onCheckpointComplete(long checkpointVersion)
Dispatched when the processing of a checkpoint has completed started

Parameters:
checkpointVersion - The checkpoint number
Returns:
A return value of true will cause the data change propagator to mark the checkpoint as handled. A best effort attempt will then be made not to resubmit the change in an event of a failure mid processing, but the handler must be prepared to handle duplicate changes in the event of a failure.

onWait

void onWait()
Dispatched when waiting for more entries to enter the log being CDC'd

This event is dispatched once each time the reader reaches the end of the log being CDC'd and it waits for a new entry to be added to the log. This event is dispatched maximum of once per checkpoint in the log.


onLogComplete

void onLogComplete(int logNumber,
                   IRogChangeDataCaptureHandler.LogCompletionReason reason,
                   Throwable errorCause)
Dispatched when the CDC has reached the end of the current log.

Parameters:
logNumber - The log number whose CDC is complete
reason - The reason for completion
errorCause - The exception that was encountered that caused the log CDC to complete. This is non-null if and only if the reason is IRogChangeDataCaptureHandler.LogCompletionReason.Error

This event is dispatched when the CDC of a log is complete and CDC is moving onto the next log.



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