|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.conf.ReplicatorRuntime
public class ReplicatorRuntime
Contains run-time data for the replicator, including properties and all active plugins. The runtime is created at configuration time and is discarded when the replicator goes off-line. The run-time handles basic life cycle management for plug-ins, which are managed through this class.
| Constructor Summary | |
|---|---|
ReplicatorRuntime(TungstenProperties properties,
OpenReplicatorContext context,
ReplicatorMonitor monitor)
Creates a new Runtime instance. |
|
| Method Summary | |
|---|---|
protected java.lang.String |
assertPropertyDefault(java.lang.String key,
java.lang.String value)
Ensures that a required property has a default if unspecified. |
protected java.lang.String |
assertPropertySet(java.lang.String key)
|
void |
configure()
Process configuration properties and instantiate/configure all plug-ins. |
static void |
configurePlugin(ReplicatorPlugin plugin,
PluginContext context)
Call configure method on a plugin class. |
FailurePolicy |
getApplierFailurePolicy()
Returns the applier failure policy. |
FailurePolicy |
getApplierFailurePolicyOn0RowUpdates()
Returns the applierFailurePolicyOn0Updates value. |
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 online options or null if the replication service has not gone online. |
OpenReplicatorContext |
getOpenReplicatorContext()
Returns OpenReplicatorContext used for registering current runtime. |
Pipeline |
getPipeline()
Returns the pipeline. |
java.lang.String |
getPipelineSource()
Returns the transaction source of the head stage in the pipeline. |
TungstenProperties |
getReplicatorProperties()
Returns the current replicator 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. |
protected void |
instantiateAndConfigurePipeline(java.lang.String name)
Instantiates a pipeline consisting of one or more stages. |
protected void |
instantiateExtensions()
Load extension classes, if defined. |
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. |
protected ReplicatorPlugin |
loadAndConfigurePlugin(java.lang.String prefix,
java.lang.String name)
Generic code to load and configure a plugin. |
boolean |
logReplicatorUpdates()
Returns true if we want to log replicator updates. |
boolean |
nativeSlaveTakeover()
Return true if operating in native slave takeover mode. |
void |
prepare()
Prepares pipeline for use. |
static void |
preparePlugin(ReplicatorPlugin plugin,
PluginContext context)
Call prepare method on a plugin class. |
void |
registerMBean(java.lang.Object mbean,
java.lang.Class<?> mbeanClass,
java.lang.String name)
Registers a JMX MBean from a lower-level component. |
void |
release()
Releases all plug-ins stored in runtime by calling their release() methods and setting the storage locations to null so they can be garbage-collected. |
static void |
releasePlugin(ReplicatorPlugin plugin,
PluginContext context)
Call release method on a plugin class, warning on errors. |
void |
setLastOnlineRoleName(java.lang.String roleName)
Writes the value of the last online role to storage. |
void |
setOnlineOptions(TungstenProperties onlineOptions)
Sets online options. |
void |
setPipelineSource(java.lang.String source)
Registers the transaction source (if any) for the head of the current pipeline. |
protected PluginSpecification |
specifyPlugin(java.lang.String prefix,
java.lang.String name)
Generic code to load and configure a plugin. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReplicatorRuntime(TungstenProperties properties,
OpenReplicatorContext context,
ReplicatorMonitor monitor)
properties - Current system properties, which are copied rather than
used directly| Method Detail |
|---|
public void configure()
throws ReplicatorException
ReplicatorException - Thrown if configuration fails
protected void instantiateExtensions()
throws ReplicatorException
ReplicatorException
protected void instantiateAndConfigurePipeline(java.lang.String name)
throws ReplicatorException
ReplicatorException
public void prepare()
throws ReplicatorException,
java.lang.InterruptedException
ReplicatorException
java.lang.InterruptedExceptionpublic void release()
public Pipeline getPipeline()
protected java.lang.String assertPropertyDefault(java.lang.String key,
java.lang.String value)
protected java.lang.String assertPropertySet(java.lang.String key)
throws ReplicatorException
ReplicatorException
protected ReplicatorPlugin loadAndConfigurePlugin(java.lang.String prefix,
java.lang.String name)
throws ReplicatorException
ReplicatorException
protected PluginSpecification specifyPlugin(java.lang.String prefix,
java.lang.String name)
throws ReplicatorException
ReplicatorExceptionpublic OpenReplicatorContext getOpenReplicatorContext()
public TungstenProperties getReplicatorProperties()
getReplicatorProperties in interface PluginContextpublic TungstenProperties getOnlineOptions()
getOnlineOptions in interface PluginContextPluginContext.getOnlineOptions()public void setOnlineOptions(TungstenProperties onlineOptions)
onlineOptions - Tungsten properties containing options from the
online commandpublic ReplicatorMonitor getMonitor()
getMonitor in interface PluginContextpublic boolean isConsistencyFailureStop()
isConsistencyFailureStop in interface PluginContextPluginContext.isConsistencyFailureStop()public boolean isConsistencyCheckColumnNames()
isConsistencyCheckColumnNames in interface PluginContextPluginContext.isConsistencyCheckColumnNames()public boolean isConsistencyCheckColumnTypes()
isConsistencyCheckColumnTypes in interface PluginContextPluginContext.isConsistencyCheckColumnTypes()public boolean isDoChecksum()
isDoChecksum in interface PluginContextPluginContext.isDoChecksum()public java.lang.String getJdbcUrl(java.lang.String database)
getJdbcUrl in interface PluginContextPluginContext.getJdbcUrl(java.lang.String)public java.lang.String getJdbcUser()
getJdbcUser in interface PluginContextPluginContext.getJdbcUser()public java.lang.String getJdbcPassword()
getJdbcPassword in interface PluginContextPluginContext.getJdbcPassword()public java.lang.String getReplicatorSchemaName()
getReplicatorSchemaName in interface PluginContextPluginContext.getReplicatorSchemaName()public java.lang.String getRoleName()
getRoleName in interface PluginContextPluginContext.getRoleName()public java.lang.String getLastOnlineRoleName()
PluginContext.getRoleName(). This value is used to help with
recovery when transitioning between states.
getLastOnlineRoleName in interface PluginContextPluginContext.getLastOnlineRoleName()
public void setLastOnlineRoleName(java.lang.String roleName)
throws ReplicatorException
ReplicatorExceptionpublic java.lang.String getSourceId()
getSourceId in interface PluginContextPluginContext.getSourceId()public java.lang.String getClusterName()
getClusterName in interface PluginContextPluginContext.getClusterName()public java.lang.String getServiceName()
getServiceName in interface PluginContextPluginContext.getServiceName()public boolean isSlave()
isSlave in interface PluginContextPluginContext.isSlave()public boolean isMaster()
isMaster in interface PluginContextPluginContext.isMaster()public boolean isAutoEnable()
isAutoEnable in interface PluginContextPluginContext.isAutoEnable()public java.util.List<Stage> getStages()
getStages in interface PluginContextPluginContext.getStages()public Store getStore(java.lang.String name)
getStore in interface PluginContextPluginContext.getStore(java.lang.String)public java.util.List<Store> getStores()
getStores in interface PluginContextPluginContext.getStores()public PipelineService getService(java.lang.String name)
getService in interface PluginContextPluginContext.getService(java.lang.String)public java.util.List<PipelineService> getServices()
getServices in interface PluginContextPluginContext.getServices()public com.continuent.tungsten.fsm.event.EventDispatcher getEventDispatcher()
getEventDispatcher in interface PluginContextPluginContext.getEventDispatcher()public boolean isRemoteService()
isRemoteService in interface PluginContextPluginContext.isRemoteService()public long getCommittedSeqno()
getCommittedSeqno in interface PluginContextPluginContext.getCommittedSeqno()
public java.util.concurrent.Future<ReplDBMSHeader> waitForCommitted(long seqno)
throws java.lang.InterruptedException
waitForCommitted in interface PluginContextjava.lang.InterruptedExceptionPluginContext.waitForCommitted(long)public FailurePolicy getApplierFailurePolicy()
getApplierFailurePolicy in interface PluginContextPluginContext.getApplierFailurePolicy()public FailurePolicy getExtractorFailurePolicy()
getExtractorFailurePolicy in interface PluginContextPluginContext.getExtractorFailurePolicy()public FailurePolicy getApplierFailurePolicyOn0RowUpdates()
public java.lang.String getTungstenTableType()
getTungstenTableType in interface PluginContextPluginContext.getTungstenTableType()public int getChannels()
getChannels in interface PluginContextPluginContext.getChannels()public ReplicatorPlugin getExtension(java.lang.String name)
getExtension in interface PluginContextPluginContext.getExtension(java.lang.String)public java.util.List<java.lang.String> getExtensionNames()
getExtensionNames in interface PluginContextPluginContext.getExtensionNames()
public void registerMBean(java.lang.Object mbean,
java.lang.Class<?> mbeanClass,
java.lang.String name)
registerMBean in interface PluginContextjava.lang.String)
public static void configurePlugin(ReplicatorPlugin plugin,
PluginContext context)
throws ReplicatorException
ReplicatorException
public static void preparePlugin(ReplicatorPlugin plugin,
PluginContext context)
throws ReplicatorException
ReplicatorException
public static void releasePlugin(ReplicatorPlugin plugin,
PluginContext context)
public boolean logReplicatorUpdates()
logReplicatorUpdates in interface PluginContextPluginContext.logReplicatorUpdates()public boolean isPrivilegedSlaveUpdate()
isPrivilegedSlaveUpdate in interface PluginContextPluginContext.isPrivilegedSlaveUpdate()public boolean nativeSlaveTakeover()
nativeSlaveTakeover in interface PluginContextPluginContext.nativeSlaveTakeover()public void setPipelineSource(java.lang.String source)
setPipelineSource in interface PluginContextsource - Typical value is a URI of some kindPluginContext.setPipelineSource(java.lang.String)public java.lang.String getPipelineSource()
getPipelineSource in interface PluginContextPluginContext.setPipelineSource(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||