com.continuent.tungsten.replicator.applier
Interface RawApplier

All Superinterfaces:
ReplicatorPlugin
All Known Implementing Classes:
DrizzleApplier, DummyApplier, InfiniDBBatchApplier, JdbcApplier, JdbcPrefetcher, MongoApplier, MySQLApplier, MySQLDrizzleApplier, OracleApplier, PostgreSQLApplier, PrefetchApplier, SimpleBatchApplier, VerticaStreamBatchApplier

public interface RawApplier
extends ReplicatorPlugin

Denotes an applier, which is responsible for applying raw DBMS events to a database or other replication target. Appliers must be prepared to be interrupted, which mechanism is used to cancel processing.

Version:
1.0
Author:
Teemu Ollakka

Method Summary
 void apply(DBMSEvent event, ReplDBMSHeader header, boolean doCommit, boolean doRollback)
          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 event.
 void rollback()
          Rolls back any current work.
 void setTaskId(int id)
          Sets the ID of the task using this raw applier.
 
Methods inherited from interface com.continuent.tungsten.replicator.plugin.ReplicatorPlugin
configure, prepare, release
 

Method Detail

setTaskId

void setTaskId(int id)
Sets the ID of the task using this raw applier.

Parameters:
id - Task ID

apply

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

Parameters:
event - Event to be applied. If a DBMSEmptyEvent, just mark the apply position.
header - Header data corresponding to event
doCommit - Boolean flag indicating whether this is the last part of multi-part event
doRollback - Boolean flag indicating whether this transaction should rollback
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

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 - Thrown if the applier is interrupted.

getLastEvent

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

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