|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface OpenReplicatorPlugin
Replicator management plug-in definition. This interface defines basic functions of a plug-in service that manages the overall replication service. OpenReplicatorPlugin instances have the following life-cycle:
NOTE:This interface should not be confused with the
TungstenPlugin
interface, which is a plugin within the native Tungsten replicator.
ReplicatorPlugin,
TungstenPlugin| Field Summary | |
|---|---|
static java.lang.String |
STATUS_APPLIED_LATENCY
Latency in seconds between sent and applied events. |
static java.lang.String |
STATUS_ERRMSG
Current error message containing last error from replicator. |
static java.lang.String |
STATUS_LAST_APPLIED
ID of last replication event applied. |
static java.lang.String |
STATUS_LAST_RECEIVED
ID of last replication event received. |
static java.lang.String |
STATUS_LAST_SENT
ID of last replication event sent. |
static java.lang.String |
STATUS_ROLE
Current replication role, such as master, slave, or standby. |
| 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()
gets the capabilties for the replicator |
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 online state, which turns on replication. |
void |
prepare(OpenReplicatorContext context)
Prepare plug-in for use. |
void |
provision(java.lang.String uri)
Performs a provision operation. |
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. |
| Field Detail |
|---|
static final java.lang.String STATUS_ROLE
static final java.lang.String STATUS_ERRMSG
static final java.lang.String STATUS_LAST_SENT
static final java.lang.String STATUS_LAST_APPLIED
static final java.lang.String STATUS_LAST_RECEIVED
static final java.lang.String STATUS_APPLIED_LATENCY
| Method Detail |
|---|
void prepare(OpenReplicatorContext context)
throws ReplicatorException
context - Context with access to replicator service resources
ReplicatorException - Thrown if resource allocation fails
void release()
throws ReplicatorException
ReplicatorException - Thrown if resource deallocation fails
void configure(TungstenProperties properties)
throws ReplicatorException
ReplicatorException - Thrown if configuration is incomplete or
fails
void online(TungstenProperties params)
throws java.lang.Exception
params - Plugin-specific name-value pairs that alter online operation
java.lang.Exception
void offline(TungstenProperties params)
throws java.lang.Exception
java.lang.Exception
void offlineDeferred(TungstenProperties params)
throws java.lang.Exception
java.lang.Exception
boolean heartbeat(TungstenProperties params)
throws java.lang.Exception
java.lang.Exception
java.lang.String flush(long timeout)
throws java.lang.Exception
timeout - Number of seconds to wait. 0 is indefinite.
java.lang.Exception
boolean waitForAppliedEvent(java.lang.String event,
long timeout)
throws java.lang.Exception
event - Event to wait fortimeout - Number of seconds to wait. 0 is indefinite.
java.lang.Exception - if there is a timeout or we are canceled
int purge(TungstenProperties params)
throws java.lang.Exception
params - 0 or more control parameters expressed as name-value
pairs
java.lang.Exception - Thrown if we timeout or are canceled
java.util.HashMap<java.lang.String,java.lang.String> status()
throws java.lang.Exception
java.lang.Exception
java.util.List<java.util.Map<java.lang.String,java.lang.String>> statusList(java.lang.String name)
throws java.lang.Exception
name - Name of the status list. 'tasks' is supported by the native
Tungsten replicator plugin.
java.lang.Exception
void provision(java.lang.String uri)
throws java.lang.Exception
uri -
java.lang.Exception
void setRole(java.lang.String role,
java.lang.String uri)
throws ReplicatorException
role - 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)
java.lang.Exception
ReplicatorException
int consistencyCheck(java.lang.String method,
java.lang.String schemaName,
java.lang.String tableName,
int rowOffset,
int rowLimit)
throws java.lang.Exception
method - 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
ReplicatorCapabilities getCapabilities()
throws java.lang.Exception
java.lang.ExceptionReplicatorRuntime getReplicatorRuntime()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||