|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.applier.MongoApplier
public class MongoApplier
Implements an applier for MongoDB. This class handles only row updates, as SQL statements are meaningless in MongoDB. We use a local version of the Tungsten trep_commit_seqno table to keep track of updates.
| Constructor Summary | |
|---|---|
MongoApplier()
|
|
| Method Summary | |
|---|---|
void |
apply(DBMSEvent event,
ReplDBMSHeader header,
boolean doCommit,
boolean doRollback)
Applies row updates to MongoDB. |
void |
commit()
Commits current open transaction to ensure data applied up to current point are durable. |
void |
configure(PluginContext context)
Complete plug-in configuration. |
ReplDBMSHeader |
getLastEvent()
Return header information corresponding to last committed event. |
void |
prepare(PluginContext context)
Prepare plug-in for use. |
void |
release(PluginContext context)
Release all resources used by plug-in. |
void |
rollback()
Rolls back any current work. |
void |
setAutoIndex(boolean autoIndex)
If set to true, generate indexes automatically on keys whenever we see a table for the first time. |
void |
setConnectString(java.lang.String connectString)
Set the MongoDB connect string, e.g., "myhost:27071". |
void |
setTaskId(int id)
Sets the ID of the task using this raw applier. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MongoApplier()
| Method Detail |
|---|
public void setConnectString(java.lang.String connectString)
public void setAutoIndex(boolean autoIndex)
public void apply(DBMSEvent event,
ReplDBMSHeader header,
boolean doCommit,
boolean doRollback)
throws ReplicatorException,
ConsistencyException,
java.lang.InterruptedException
apply in interface RawApplierevent - Event to be applied. If a DBMSEmptyEvent, just mark the
apply position.header - Header data corresponding to eventdoCommit - Boolean flag indicating whether this is the last part of
multi-part eventdoRollback - Boolean flag indicating whether this transaction should
rollback
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 interruptedRawApplier.apply(com.continuent.tungsten.replicator.event.DBMSEvent,
com.continuent.tungsten.replicator.event.ReplDBMSHeader, boolean,
boolean)
public void commit()
throws ReplicatorException,
java.lang.InterruptedException
commit in interface RawApplierReplicatorException - Thrown if applier processing fails
java.lang.InterruptedException - Thrown if the applier is interruptedRawApplier.commit()
public ReplDBMSHeader getLastEvent()
throws ReplicatorException,
java.lang.InterruptedException
getLastEvent in interface RawApplierReplicatorException - Thrown if getting sequence number fails
java.lang.InterruptedException - Thrown if the applier is interruptedRawApplier.getLastEvent()
public void rollback()
throws java.lang.InterruptedException
rollback in interface RawApplierjava.lang.InterruptedException - Thrown if the applier is interrupted.RawApplier.rollback()public void setTaskId(int id)
setTaskId in interface RawApplierid - Task IDRawApplier.setTaskId(int)
public void configure(PluginContext context)
throws ReplicatorException,
java.lang.InterruptedException
configure in interface ReplicatorPluginReplicatorException - Thrown if configuration is incomplete or
fails
java.lang.InterruptedExceptionReplicatorPlugin.configure(com.continuent.tungsten.replicator.plugin.PluginContext)
public void prepare(PluginContext context)
throws ReplicatorException,
java.lang.InterruptedException
prepare in interface ReplicatorPluginReplicatorException - Thrown if resource allocation fails
java.lang.InterruptedExceptionReplicatorPlugin.prepare(com.continuent.tungsten.replicator.plugin.PluginContext)
public void release(PluginContext context)
throws ReplicatorException,
java.lang.InterruptedException
release in interface ReplicatorPluginReplicatorException - Thrown if resource deallocation fails
java.lang.InterruptedExceptionReplicatorPlugin.release(com.continuent.tungsten.replicator.plugin.PluginContext)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||