|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.management.NotificationBroadcasterSupport
com.continuent.tungsten.replicator.management.script.ScriptPlugin
public class ScriptPlugin
This class defines an OpenReplicatorPlugin that invokes an external program to control replication.
| Field Summary | |
|---|---|
static java.lang.String |
ARG_URI
|
| Fields inherited from interface com.continuent.tungsten.replicator.management.OpenReplicatorPlugin |
|---|
STATUS_APPLIED_LATENCY, STATUS_ERRMSG, STATUS_LAST_APPLIED, STATUS_LAST_RECEIVED, STATUS_LAST_SENT, STATUS_ROLE |
| Constructor Summary | |
|---|---|
ScriptPlugin()
|
|
| Method Summary | |
|---|---|
void |
configure(TungstenProperties properties)
Read configuration data and configure replication behavior appropriately. |
int |
consistencyCheck(java.lang.String method,
java.lang.String schemaName,
java.lang.String tableName,
int rowOffset,
int rowLimit)
Initiates consistency check transaction on a given table. |
java.lang.String |
flush(long timeout)
Implements a flush operation to synchronize the state of the database with the replication log and return a comparable event ID that can be used in a wait operation on a slave. |
ReplicatorCapabilities |
getCapabilities()
Return the capabilities of this replicator plugin. |
ReplicatorRuntime |
getReplicatorRuntime()
|
boolean |
heartbeat(TungstenProperties params)
Inserts a heartbeat event into the transaction history. |
void |
offline(TungstenProperties params)
Puts the replicator into the offline state, which turns off replication. |
void |
offlineDeferred(TungstenProperties params)
Issues a request to go offline at a later point in replication. |
void |
online(TungstenProperties params)
Puts the replicator into the goingonline state, which turns on replication. |
void |
prepare(OpenReplicatorContext context)
Prepare plug-in for use. |
void |
provision(java.lang.String uri)
Calls the provision method on the script. |
int |
purge(TungstenProperties params)
Kill logins other than the connection(s) used for replication. |
void |
release()
Release all resources used by plug-in. |
void |
setRole(java.lang.String role,
java.lang.String uri)
Sets the replicator role. |
java.util.HashMap<java.lang.String,java.lang.String> |
status()
Returns the current replicator status as a set of name-value pairs. |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
statusList(java.lang.String name)
Returns a list of status instances for a particular list of items. |
boolean |
waitForAppliedEvent(java.lang.String event,
long timeout)
Wait for a particular event to be applied on the slave. |
| Methods inherited from class javax.management.NotificationBroadcasterSupport |
|---|
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ARG_URI
| Constructor Detail |
|---|
public ScriptPlugin()
| Method Detail |
|---|
public void prepare(OpenReplicatorContext context)
throws ReplicatorException
prepare in interface OpenReplicatorPlugincontext - Context with access to replicator service resources
ReplicatorException - Thrown if resource allocation failsOpenReplicatorPlugin.prepare(OpenReplicatorContext)
public void release()
throws ReplicatorException
release in interface OpenReplicatorPluginReplicatorException - Thrown if resource deallocation failsOpenReplicatorPlugin.release()
public void configure(TungstenProperties properties)
throws ReplicatorException
configure in interface OpenReplicatorPluginReplicatorException - Thrown if configuration is incomplete or
failsOpenReplicatorPlugin.configure(com.continuent.tungsten.common.config.TungstenProperties)
public void online(TungstenProperties params)
throws java.lang.Exception
online in interface OpenReplicatorPluginparams - Plugin-specific name-value pairs that alter online operation
java.lang.Exception
public void offline(TungstenProperties params)
throws java.lang.Exception
offline in interface OpenReplicatorPluginjava.lang.Exception
public void offlineDeferred(TungstenProperties params)
throws java.lang.Exception
offlineDeferred in interface OpenReplicatorPluginjava.lang.ExceptionOpenReplicatorPlugin.offlineDeferred(com.continuent.tungsten.common.config.TungstenProperties)
public boolean heartbeat(TungstenProperties params)
throws java.lang.Exception
heartbeat in interface OpenReplicatorPluginjava.lang.ExceptionOpenReplicatorPlugin.heartbeat(com.continuent.tungsten.common.config.TungstenProperties)
public java.lang.String flush(long timeout)
throws java.lang.Exception
flush in interface OpenReplicatorPlugintimeout - Number of seconds to wait. 0 is indefinite.
java.lang.Exception
public int purge(TungstenProperties params)
throws java.lang.Exception
purge in interface OpenReplicatorPluginparams - 0 or more control parameters expressed as name-value pairs
java.lang.Exception - Thrown if we timeout or are canceled
public boolean waitForAppliedEvent(java.lang.String event,
long timeout)
throws java.lang.Exception
waitForAppliedEvent in interface OpenReplicatorPluginevent - Event to wait fortimeout - Number of seconds to wait. 0 is indefinite.
java.lang.Exception - if there is a timeout or we are canceled
public java.util.HashMap<java.lang.String,java.lang.String> status()
throws java.lang.Exception
status in interface OpenReplicatorPluginjava.lang.Exception
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> statusList(java.lang.String name)
throws java.lang.Exception
statusList in interface OpenReplicatorPluginname - Name of the status list. 'tasks' is supported by the native
Tungsten replicator plugin.
java.lang.ExceptionOpenReplicatorPlugin.statusList(java.lang.String)
public void provision(java.lang.String uri)
throws java.lang.Exception
provision in interface OpenReplicatorPluginjava.lang.ExceptionOpenReplicatorPlugin.provision(java.lang.String)
public int consistencyCheck(java.lang.String method,
java.lang.String schemaName,
java.lang.String tableName,
int rowOffset,
int rowLimit)
throws java.lang.Exception
OpenReplicatorPlugin
consistencyCheck in interface OpenReplicatorPluginmethod - consistency check method to useschemaName - name of the table schematableName - name of the table, if null all tables in schema are
checkedrowOffset - start consistency check from this row (numeration starts
with 0). If negative - whole table is checked.rowLimit - limit consistency check to that many rows. If rowOffset
is negative this is ignored.
java.lang.Exception
public void setRole(java.lang.String role,
java.lang.String uri)
throws ReplicatorException
setRole in interface OpenReplicatorPluginrole - A supported role name, such as 'master', 'slave', or
'standby'uri - An optional URI referring to another replicator if required
for role (e.g., a slave typically points to a master)
ReplicatorExceptionOpenReplicatorPlugin.setRole(java.lang.String,
java.lang.String)
public ReplicatorCapabilities getCapabilities()
throws java.lang.Exception
getCapabilities in interface OpenReplicatorPluginjava.lang.Exceptionpublic ReplicatorRuntime getReplicatorRuntime()
getReplicatorRuntime in interface OpenReplicatorPlugin
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||