|
||||||||||
| 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.tungsten.TungstenPlugin
public class TungstenPlugin
This class defines a ReplicatorManager, which is the starting class for a Tungsten Replicator instance. The ReplicatorManager accepts the following Java properties which may be set prior to startup.
| Field Summary |
|---|
| 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 | |
|---|---|
TungstenPlugin()
|
|
| 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. |
static Table |
findConsistencyTable(Database conn,
java.lang.String replicatorSchema)
Tries to locate consistency check table. |
static int |
findNextConsistencyId(Database conn,
Table ct)
Finds what ID should be used for the next consistency check. |
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()
gets the capabilties for the replicator |
ReplicatorRuntime |
getReplicatorRuntime()
|
boolean |
heartbeat(TungstenProperties params)
Starts a heartbeat event. |
void |
offline(TungstenProperties params)
Puts the replicator immediately into the offline state, which turns off replication. |
void |
offlineDeferred(TungstenProperties params)
Performs a deferred shutdown. |
void |
online(TungstenProperties params)
Puts the replicator into the online state, which turns on replication. |
void |
prepare(OpenReplicatorContext context)
Set event dispatcher and instantiate the Tungsten monitor. |
void |
provision(java.lang.String uri)
Performs a provision operation. |
int |
purge(TungstenProperties params)
Wait for a particular event to be committed on the slave. |
void |
release()
Deallocate all resources. |
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 |
| Constructor Detail |
|---|
public TungstenPlugin()
| 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 int consistencyCheck(java.lang.String method,
java.lang.String schemaName,
java.lang.String tableName,
int rowOffset,
int rowLimit)
throws java.lang.Exception
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.ExceptionOpenReplicatorPlugin.consistencyCheck(java.lang.String,
java.lang.String, java.lang.String, int, int)
public static Table findConsistencyTable(Database conn,
java.lang.String replicatorSchema)
throws java.lang.Exception
conn - Database connection.replicatorSchema - Schema name of the Replicator service.
java.lang.Exception
public static int findNextConsistencyId(Database conn,
Table ct)
throws java.lang.Exception
conn - Database connection.ct - Consistency check table.
java.lang.Exception - If SQL query fails.
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
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
OpenReplicatorPlugin
provision in interface OpenReplicatorPluginjava.lang.Exception
public ReplicatorCapabilities getCapabilities()
throws java.lang.Exception
OpenReplicatorPlugin
getCapabilities in interface OpenReplicatorPluginjava.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 ReplicatorRuntime getReplicatorRuntime()
getReplicatorRuntime in interface OpenReplicatorPlugin
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||