com.continuent.tungsten.replicator.applier
Interface Applier

All Superinterfaces:
ReplicatorPlugin
All Known Subinterfaces:
ParallelApplier
All Known Implementing Classes:
ApplierWrapper, InMemoryMultiQueueApplier, InMemoryQueueAdapter, InMemoryTransactionalQueueApplier, ParallelQueueApplier, THLParallelQueueApplier, THLStoreApplier

public interface Applier
extends ReplicatorPlugin

Denotes an applier that can process events with full metadata.

Author:
Robert Hodges
See Also:
RawApplier

Method Summary
 void apply(ReplDBMSEvent event, boolean doCommit, boolean doRollback, boolean syncTHL)
          Apply the proffered event to the replication target.
 void commit()
          Commits current open transaction to ensure data applied up to current point are durable.
 ReplDBMSHeader getLastEvent()
          Return header information corresponding to last committed transaction.
 void rollback()
          Rolls back any current work.
 void updatePosition(ReplDBMSHeader header, boolean doCommit, boolean syncTHL)
          Update current recovery position but do not apply an event.
 
Methods inherited from interface com.continuent.tungsten.replicator.plugin.ReplicatorPlugin
configure, prepare, release
 

Method Detail

apply

void apply(ReplDBMSEvent event,
           boolean doCommit,
           boolean doRollback,
           boolean syncTHL)
           throws ReplicatorException,
                  ConsistencyException,
                  java.lang.InterruptedException
Apply the proffered event to the replication target.

Parameters:
event - Event to be applied
doCommit - Boolean flag indicating whether this is the last part of multipart event
doRollback - Boolean flag indicating whether this transaction should rollback
syncTHL - Should this applier synchronize the trep_commit_seqno table? This should be false for slave.
Throws:
ReplicatorException - Thrown if applier processing fails
ConsistencyException - Thrown if the applier detects that a consistency check has failed
java.lang.InterruptedException - Thrown if the applier is interrupted

updatePosition

void updatePosition(ReplDBMSHeader header,
                    boolean doCommit,
                    boolean syncTHL)
                    throws ReplicatorException,
                           java.lang.InterruptedException
Update current recovery position but do not apply an event.

Parameters:
header - Header containing seqno, event ID, etc.
doCommit - Boolean flag indicating whether this is the last part of multipart event
syncTHL - Should this applier synchronize the trep_commit_seqno table? This should be false for slave.
Throws:
ReplicatorException - Thrown if applier processing fails
java.lang.InterruptedException - Thrown if the applier is interrupted

commit

void commit()
            throws ReplicatorException,
                   java.lang.InterruptedException
Commits current open transaction to ensure data applied up to current point are durable.

Throws:
ReplicatorException - Thrown if applier processing fails
java.lang.InterruptedException - Thrown if the applier is interrupted

rollback

void rollback()
              throws java.lang.InterruptedException
Rolls back any current work.

Throws:
java.lang.InterruptedException

getLastEvent

ReplDBMSHeader getLastEvent()
                            throws ReplicatorException,
                                   java.lang.InterruptedException
Return header information corresponding to last committed transaction.

Returns:
Header data for last committed transaction
Throws:
ReplicatorException - Thrown if getting sequence number fails
java.lang.InterruptedException - Thrown if the applier is interrupted