com.continuent.tungsten.replicator.plugin
Interface PluginContext

All Known Implementing Classes:
ReplicatorRuntime

public interface PluginContext

This class defines a context passed into replicator plugins that exposes call-backs into the replicator itself to fetch configuration information and invoke services.

Version:
1.0
Author:
Robert Hodges

Method Summary
 FailurePolicy getApplierFailurePolicy()
          Returns the applier failure policy.
 int getChannels()
          Returns the number of channels in the tail stage of the pipeline or -1 if pipeline is not active.
 java.lang.String getClusterName()
          Cluster name to which replicator belongs.
 long getCommittedSeqno()
          Returns the minimum safely committed sequence number from the end of the pipeline.
 com.continuent.tungsten.fsm.event.EventDispatcher getEventDispatcher()
          Returns the event dispatcher for reporting interesting events.
 ReplicatorPlugin getExtension(java.lang.String name)
          Returns the named extension or null if the extension does not exist.
 java.util.List<java.lang.String> getExtensionNames()
          Returns the current list of extensions.
 FailurePolicy getExtractorFailurePolicy()
          Returns the extractorFailurePolicy value.
 java.lang.String getJdbcPassword()
          Returns a password suitable for login to local data source.
 java.lang.String getJdbcUrl(java.lang.String database)
          Returns a JDBC URL suitable for login to local data source.
 java.lang.String getJdbcUser()
          Returns a user for login to local data source.
 java.lang.String getLastOnlineRoleName()
          Returns the role as of the last time the replicator went online or null if the role is not known.
 ReplicatorMonitor getMonitor()
          Returns the monitoring data object.
 TungstenProperties getOnlineOptions()
          Returns current runtime options set when the replicator went online or null if replicator has not gone online yet.
 java.lang.String getPipelineSource()
          Returns the transaction source of the head stage in the pipeline.
 TungstenProperties getReplicatorProperties()
          Returns the current replicator configuration properties.
 java.lang.String getReplicatorSchemaName()
          Schema name for storing replicator catalogs.
 java.lang.String getRoleName()
          Returns the role name.
 PipelineService getService(java.lang.String name)
          Returns a named pipeline service component.
 java.lang.String getServiceName()
          Service name to which replication belongs.
 java.util.List<PipelineService> getServices()
          Returns all pipeline service components.
 java.lang.String getSourceId()
          Source ID for this replicator.
 java.util.List<Stage> getStages()
          Returns stages in pipeline order.
 Store getStore(java.lang.String name)
          Returns a named storage component.
 java.util.List<Store> getStores()
          Returns all stores.
 java.lang.String getTungstenTableType()
          Returns the table type used for Tungsten catalog databases.
 boolean isAutoEnable()
          Returns true if replicator should go on-line automatically.
 boolean isConsistencyCheckColumnNames()
          Should consistency check be sensitive to column names?
 boolean isConsistencyCheckColumnTypes()
          Should consistency check be sensitive to column types?
 boolean isConsistencyFailureStop()
          True if the replicator should stop on checksum failure.
 boolean isDoChecksum()
          Are checksums enabled? If false this overrides any local checksum setting.
 boolean isMaster()
          Returns true if the replicator role is master.
 boolean isPrivilegedSlaveUpdate()
          Returns true if the JDBC login for slave apply is a superuser.
 boolean isRemoteService()
          Returns true if the current replication pipeline belongs to a remote data service.
 boolean isSlave()
          Returns true if the replicator role is slave.
 boolean logReplicatorUpdates()
          Returns true if we want to log replicator updates.
 boolean nativeSlaveTakeover()
          Return true if operating in native slave takeover mode.
 void registerMBean(java.lang.Object mbean, java.lang.Class<?> mbeanClass, java.lang.String name)
          Registers a JMX MBean from a lower-level component.
 void setPipelineSource(java.lang.String source)
          Registers the transaction source (if any) for the head of the current pipeline.
 java.util.concurrent.Future<ReplDBMSHeader> waitForCommitted(long seqno)
          Returns a future to allow clients to wait until the pipeline has safely committed the requested seqno.
 

Method Detail

getReplicatorProperties

TungstenProperties getReplicatorProperties()
Returns the current replicator configuration properties.


getOnlineOptions

TungstenProperties getOnlineOptions()
Returns current runtime options set when the replicator went online or null if replicator has not gone online yet.


getJdbcUrl

java.lang.String getJdbcUrl(java.lang.String database)
Returns a JDBC URL suitable for login to local data source.


getJdbcUser

java.lang.String getJdbcUser()
Returns a user for login to local data source.


getJdbcPassword

java.lang.String getJdbcPassword()
Returns a password suitable for login to local data source.


getReplicatorSchemaName

java.lang.String getReplicatorSchemaName()
Schema name for storing replicator catalogs.


getApplierFailurePolicy

FailurePolicy getApplierFailurePolicy()
Returns the applier failure policy.


getExtractorFailurePolicy

FailurePolicy getExtractorFailurePolicy()
Returns the extractorFailurePolicy value.


isConsistencyFailureStop

boolean isConsistencyFailureStop()
True if the replicator should stop on checksum failure.


isConsistencyCheckColumnNames

boolean isConsistencyCheckColumnNames()
Should consistency check be sensitive to column names?


isConsistencyCheckColumnTypes

boolean isConsistencyCheckColumnTypes()
Should consistency check be sensitive to column types?


isDoChecksum

boolean isDoChecksum()
Are checksums enabled? If false this overrides any local checksum setting.


getSourceId

java.lang.String getSourceId()
Source ID for this replicator.


getClusterName

java.lang.String getClusterName()
Cluster name to which replicator belongs.


getServiceName

java.lang.String getServiceName()
Service name to which replication belongs.


getRoleName

java.lang.String getRoleName()
Returns the role name.


getLastOnlineRoleName

java.lang.String getLastOnlineRoleName()
Returns the role as of the last time the replicator went online or null if the role is not known. When the replicator is in the ONLINE state the is the same as getRoleName(). This value is used to help with recovery when transitioning between states.


isSlave

boolean isSlave()
Returns true if the replicator role is slave.


isMaster

boolean isMaster()
Returns true if the replicator role is master.


isAutoEnable

boolean isAutoEnable()
Returns true if replicator should go on-line automatically.


getStages

java.util.List<Stage> getStages()
Returns stages in pipeline order.


getStore

Store getStore(java.lang.String name)
Returns a named storage component.


getStores

java.util.List<Store> getStores()
Returns all stores.


getService

PipelineService getService(java.lang.String name)
Returns a named pipeline service component.


getServices

java.util.List<PipelineService> getServices()
Returns all pipeline service components.


getMonitor

ReplicatorMonitor getMonitor()
Returns the monitoring data object.


getEventDispatcher

com.continuent.tungsten.fsm.event.EventDispatcher getEventDispatcher()
Returns the event dispatcher for reporting interesting events.


getExtension

ReplicatorPlugin getExtension(java.lang.String name)
Returns the named extension or null if the extension does not exist.


getExtensionNames

java.util.List<java.lang.String> getExtensionNames()
Returns the current list of extensions.


registerMBean

void registerMBean(java.lang.Object mbean,
                   java.lang.Class<?> mbeanClass,
                   java.lang.String name)
Registers a JMX MBean from a lower-level component.


isRemoteService

boolean isRemoteService()
Returns true if the current replication pipeline belongs to a remote data service. If so, applied updates must be logged to ensure correct multi-master behavior.


logReplicatorUpdates

boolean logReplicatorUpdates()
Returns true if we want to log replicator updates. This is equivalent to MySQL's log_slave_updates option.


isPrivilegedSlaveUpdate

boolean isPrivilegedSlaveUpdate()
Returns true if the JDBC login for slave apply is a superuser.


nativeSlaveTakeover

boolean nativeSlaveTakeover()
Return true if operating in native slave takeover mode.


getCommittedSeqno

long getCommittedSeqno()
Returns the minimum safely committed sequence number from the end of the pipeline. This sequence number can be used to free resources such as log files used in upstream stages.


waitForCommitted

java.util.concurrent.Future<ReplDBMSHeader> waitForCommitted(long seqno)
                                                             throws java.lang.InterruptedException
Returns a future to allow clients to wait until the pipeline has safely committed the requested seqno.

Throws:
java.lang.InterruptedException

setPipelineSource

void setPipelineSource(java.lang.String source)
Registers the transaction source (if any) for the head of the current pipeline. Should be used by head stage only to avoid confusion. For best usability, head stages should set this as soon as it is known.

Parameters:
source - Typical value is a URI of some kind

getPipelineSource

java.lang.String getPipelineSource()
Returns the transaction source of the head stage in the pipeline.


getTungstenTableType

java.lang.String getTungstenTableType()
Returns the table type used for Tungsten catalog databases. This value is meaningful only for MySQL databases and related data warehouse offspring like InfiniDB and InfoBright.


getChannels

int getChannels()
Returns the number of channels in the tail stage of the pipeline or -1 if pipeline is not active.