|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.prefetch.PrefetchApplier
public class PrefetchApplier
Implements a JDBC prefetcher. This class is currently for MySQL only as it assumes MySQL syntax and index structure.
| Field Summary | |
|---|---|
protected Database |
conn
|
protected java.util.HashMap<java.lang.String,java.lang.String> |
currentOptions
|
protected java.lang.String |
currentSchema
|
protected long |
currentTimestamp
|
protected java.lang.String |
driver
|
protected java.util.regex.Pattern |
ignoreSessionPattern
|
protected java.lang.String |
ignoreSessionVars
|
protected int |
maxErrors
|
protected int |
maxSQLLogLength
Maximum length of SQL string to log in case of an error. |
protected java.lang.String |
metadataSchema
|
protected java.lang.String |
password
|
protected int |
prefetchRowLimit
|
protected PluginContext |
runtime
|
protected int |
slowQueryCacheDuration
|
protected int |
slowQueryCacheSize
|
protected int |
slowQueryRows
|
protected double |
slowQuerySelectivity
|
protected java.sql.Statement |
statement
|
protected int |
taskId
|
protected java.lang.String |
url
|
protected java.lang.String |
user
|
| Constructor Summary | |
|---|---|
PrefetchApplier()
|
|
| 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. |
void |
configure(PluginContext context)
Complete plug-in configuration. |
Database |
getDatabase()
|
ReplDBMSHeader |
getLastEvent()
Return header information corresponding to last committed event. |
int |
getMaxErrors()
|
int |
getPrefetchRowLimit()
|
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 |
setDriver(java.lang.String driver)
|
void |
setIgnoreSessionVars(java.lang.String ignoreSessionVars)
|
void |
setMaxErrors(int maxErrors)
|
void |
setPassword(java.lang.String password)
|
void |
setPrefetchRowLimit(int prefetchRowLimit)
|
void |
setSlowQueryCacheDuration(int slowQueryCacheDuration)
|
void |
setSlowQueryCacheSize(int slowQueryCacheSize)
|
void |
setSlowQueryRows(int slowQueryRows)
|
void |
setSlowQuerySelectivity(double slowQuerySelectivity)
|
void |
setTaskId(int id)
Sets the ID of the task using this raw applier. |
void |
setUrl(java.lang.String url)
|
void |
setUser(java.lang.String user)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int taskId
protected java.lang.String driver
protected java.lang.String url
protected java.lang.String user
protected java.lang.String password
protected java.lang.String ignoreSessionVars
protected int slowQueryCacheSize
protected int slowQueryRows
protected double slowQuerySelectivity
protected int slowQueryCacheDuration
protected int prefetchRowLimit
protected int maxErrors
protected PluginContext runtime
protected java.lang.String metadataSchema
protected Database conn
protected java.sql.Statement statement
protected java.util.regex.Pattern ignoreSessionPattern
protected java.lang.String currentSchema
protected long currentTimestamp
protected java.util.HashMap<java.lang.String,java.lang.String> currentOptions
protected int maxSQLLogLength
| Constructor Detail |
|---|
public PrefetchApplier()
| Method Detail |
|---|
public void setTaskId(int id)
setTaskId in interface RawApplierid - Task IDRawApplier.setTaskId(int)public void setDriver(java.lang.String driver)
public Database getDatabase()
public void setUrl(java.lang.String url)
public void setUser(java.lang.String user)
public void setPassword(java.lang.String password)
public void setIgnoreSessionVars(java.lang.String ignoreSessionVars)
public void setSlowQueryCacheSize(int slowQueryCacheSize)
public void setSlowQueryRows(int slowQueryRows)
public void setSlowQuerySelectivity(double slowQuerySelectivity)
public void setSlowQueryCacheDuration(int slowQueryCacheDuration)
public int getPrefetchRowLimit()
public void setPrefetchRowLimit(int prefetchRowLimit)
public int getMaxErrors()
public void setMaxErrors(int maxErrors)
public void apply(DBMSEvent event,
ReplDBMSHeader header,
boolean doCommit,
boolean doRollback)
throws ReplicatorException
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 failedRawApplier.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 void rollback()
throws java.lang.InterruptedException
rollback in interface RawApplierjava.lang.InterruptedException - Thrown if the applier is interrupted.RawApplier.rollback()
public ReplDBMSHeader getLastEvent()
throws ReplicatorException
getLastEvent in interface RawApplierReplicatorException - Thrown if getting sequence number failsRawApplier.getLastEvent()
public void prepare(PluginContext context)
throws ReplicatorException
prepare in interface ReplicatorPluginReplicatorException - Thrown if resource allocation failsReplicatorPlugin.prepare(com.continuent.tungsten.replicator.plugin.PluginContext)
public void configure(PluginContext context)
throws ReplicatorException
configure in interface ReplicatorPluginReplicatorException - Thrown if configuration is incomplete or
failsReplicatorPlugin.configure(com.continuent.tungsten.replicator.plugin.PluginContext)
public void release(PluginContext context)
throws ReplicatorException
release in interface ReplicatorPluginReplicatorException - Thrown if resource deallocation failsReplicatorPlugin.release(com.continuent.tungsten.replicator.plugin.PluginContext)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||