com.continuent.tungsten.common.cluster.resource
Class Replicator

java.lang.Object
  extended by com.continuent.tungsten.common.cluster.resource.Resource
      extended by com.continuent.tungsten.common.cluster.resource.Replicator
All Implemented Interfaces:
java.io.Serializable

public class Replicator
extends Resource
implements java.io.Serializable

Defines a replicator resource. Among other things this class contains the definitive reference to names that replicators must use for monitoring properties.

See Also:
Serialized Form

Field Summary
static java.lang.String APPLIED_LAST_EVENT_ID
          Last native transaction ID applied to slave database.
static java.lang.String APPLIED_LAST_SEQNO
          Last LSN (log sequence number) applied to slave database.
static java.lang.String APPLIED_LATENCY
          Lag in seconds between the time last event was applied and when it was originally generated.
static java.lang.String CLUSTERNAME
          Name of the cluster to which this replicator belongs.
static java.lang.String CURRENT_EVENT_ID
          Current native transaction ID in the database.
static java.lang.String CURRENT_TIME_MILLIS
          Current time on replicator expressed as milliseconds since Jan 1, 1970.
static java.lang.String DATASERVERHOST
          Host name of this replicator.
static java.lang.String DEFAULT_LAST_EVENT_ID
           
static long DEFAULT_LATEST_EPOCH_NUMBER
           
static java.lang.String LATEST_EPOCH_NUMBER
          Current epoch number used by replicator, if it has one.
static java.lang.String MASTER_CONNECT_URI
          URI to which slave replicator connects.
static java.lang.String MASTER_LISTEN_URI
          URI that slaves should use when connecting to this master.
static java.lang.String MASTER_URI
          Deprecated.  
static java.lang.String MAX_STORED_SEQNO
          Highest LSN stored in the replicator log.
static java.lang.String MIN_STORED_SEQNO
          Lowest LSN stored in the replicator log.
static java.lang.String OFFLINE_REQUESTS
          Pending offline requests in text form.
static java.lang.String PENDING_ERROR
          Current error, if there is one.
static java.lang.String PENDING_ERROR_CODE
          Current error code, if there is one.
static java.lang.String PENDING_ERROR_EVENTID
          Current failed event ID or null if there is none.
static java.lang.String PENDING_ERROR_SEQNO
          Current failed log sequence number or -1 if there is none.
static java.lang.String PENDING_EXCEPTION_MESSAGE
          Current exception that caused error, if there is one.
static java.lang.String RESOURCE_IS_STANDBY_DATASOURCE
           
static java.lang.String RESOURCE_JDBC_DRIVER
          Class name of Java data source.
static java.lang.String RESOURCE_JDBC_URL
          URL to connect to underlying data source replicator serves.
static java.lang.String RESOURCE_PRECEDENCE
          Resource precedence for failover, which should be an integer > 0 or -1 to indicate do not fail over to this resource.
static java.lang.String RESOURCE_VENDOR
          DBMS vendor string for this data source
static java.lang.String RESOURCE_VIP_ADDRESS
           
static java.lang.String RESOURCE_VIP_INTERFACE
           
static java.lang.String ROLE
          Role of this replicator.
static java.lang.String SEQNO_TYPE
          Log sequence number type to allow managers to figure out how to sort values.
static java.lang.String SEQNO_TYPE_LONG
          Denotes a numeric log sequence number type that is convertible to a Java Long type.
static java.lang.String SEQNO_TYPE_STRING
          Denotes a string log sequence number type whose values are comparable strings.
static java.lang.String SOURCEID
          Source ID used to mark events for this replicator.
static java.lang.String STATE
          Current replicator state.
static java.lang.String TIME_IN_STATE_SECONDS
          Seconds that replicator has been in its current state.
static java.lang.String UPTIME_SECONDS
          Seconds since replicator has started.
static java.lang.String USE_SSL_CONNECTION
          Indicates if SSL connection is used.
 
Fields inherited from class com.continuent.tungsten.common.cluster.resource.Resource
childType, compositeMember, description, isContainer, isExecutable, name, type
 
Constructor Summary
Replicator()
          Creates a new Replicator object
Replicator(java.lang.String key, java.lang.String clusterName, java.lang.String host)
           
 
Method Summary
static Replicator createFromReplicatorStatus(TungstenProperties replicatorProps)
           
 java.lang.String getAppliedLastEventId()
          Returns the appliedLastEventId value.
 long getAppliedLastSeqno()
          Returns the appliedLastSeqno value.
 double getAppliedLatency()
          Returns the appliedLatency value.
 java.lang.String getDataServiceName()
          Returns the dataServiceName value.
 java.lang.String getHost()
          Returns the host value.
 long getLatestEpochNumber()
          Returns the latestEpochNumber value.
 java.lang.String getMasterConnectUri()
          Returns the masterConnectUri value.
 java.lang.String getMasterListenUri()
          Returns the masterListenUri value.
 java.lang.String getResourceJdbcDriver()
          Returns the resourceJdbcDriver value.
 java.lang.String getResourceJdbcUrl()
          Returns the resourceJdbcUrl value.
 java.lang.String getRole()
          Returns the role value.
 java.lang.String getSourceId()
          Returns the sourceId value.
 java.lang.String getState()
          Returns the state value.
 java.lang.String getVendor()
          Returns the vendor value.
 java.lang.String getVipAddress()
          Returns the vipAddress value.
 java.lang.String getVipInterface()
          Returns the vipInterface value.
 boolean isStandbyDataSource()
          Returns the isStandbyDataSource value.
 void setAppliedLastEventId(java.lang.String appliedLastEventId)
          Sets the appliedLastEventId value.
 void setAppliedLastSeqno(long appliedLastSeqno)
          Sets the appliedLastSeqno value.
 void setAppliedLatency(double appliedLatency)
          Sets the appliedLatency value.
 void setDataServiceName(java.lang.String dataServiceName)
          Sets the dataServiceName value.
 void setHost(java.lang.String host)
          Sets the host value.
 void setLatestEpochNumber(long latestEpochNumber)
          Sets the latestEpochNumber value.
 void setMasterConnectUri(java.lang.String masterConnectUri)
          Sets the masterConnectUri value.
 void setMasterListenUri(java.lang.String masterListenUri)
          Sets the masterListenUri value.
 void setResourceJdbcDriver(java.lang.String resourceJdbcDriver)
          Sets the resourceJdbcDriver value.
 void setResourceJdbcUrl(java.lang.String resourceJdbcUrl)
          Sets the resourceJdbcUrl value.
 void setRole(java.lang.String role)
          Sets the role value.
 void setSourceId(java.lang.String sourceId)
          Sets the sourceId value.
 void setStandbyDataSource(boolean isStandbyDataSource)
          Sets the isStandbyDataSource value.
 void setState(java.lang.String state)
          Sets the state value.
 void setVendor(java.lang.String vendor)
          Sets the vendor value.
 void setVipAddress(java.lang.String vipAddress)
          Sets the vipAddress value.
 void setVipInterface(java.lang.String vipInterface)
          Sets the vipInterface value.
 
Methods inherited from class com.continuent.tungsten.common.cluster.resource.Resource
copyTo, describe, getChildType, getCompositeMember, getKey, getName, getType, isContainer, isExecutable, setChildType, setCompositeMember, setContainer, setExecutable, setName, setType, toJSON, toProperties, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

APPLIED_LAST_SEQNO

public static final java.lang.String APPLIED_LAST_SEQNO
Last LSN (log sequence number) applied to slave database. On a master this is the same as the last position read from the log.

See Also:
Constant Field Values

APPLIED_LAST_EVENT_ID

public static final java.lang.String APPLIED_LAST_EVENT_ID
Last native transaction ID applied to slave database. On a master this is the same as the last native transaction ID read from the log.

See Also:
Constant Field Values

APPLIED_LATENCY

public static final java.lang.String APPLIED_LATENCY
Lag in seconds between the time last event was applied and when it was originally generated.

See Also:
Constant Field Values

LATEST_EPOCH_NUMBER

public static final java.lang.String LATEST_EPOCH_NUMBER
Current epoch number used by replicator, if it has one.

See Also:
Constant Field Values

MIN_STORED_SEQNO

public static final java.lang.String MIN_STORED_SEQNO
Lowest LSN stored in the replicator log. Value is null if there is no log.

See Also:
Constant Field Values

MAX_STORED_SEQNO

public static final java.lang.String MAX_STORED_SEQNO
Highest LSN stored in the replicator log. Value is null if there is no log. This value is used for selecting slaves for failover.

See Also:
Constant Field Values

CURRENT_EVENT_ID

public static final java.lang.String CURRENT_EVENT_ID
Current native transaction ID in the database. On a slave this value may be null.

See Also:
Constant Field Values

MASTER_CONNECT_URI

public static final java.lang.String MASTER_CONNECT_URI
URI to which slave replicator connects. Undefined for master.

See Also:
Constant Field Values

MASTER_LISTEN_URI

public static final java.lang.String MASTER_LISTEN_URI
URI that slaves should use when connecting to this master.

See Also:
Constant Field Values

USE_SSL_CONNECTION

public static final java.lang.String USE_SSL_CONNECTION
Indicates if SSL connection is used.

See Also:
Constant Field Values

CLUSTERNAME

public static final java.lang.String CLUSTERNAME
Name of the cluster to which this replicator belongs.

See Also:
Constant Field Values

ROLE

public static final java.lang.String ROLE
Role of this replicator. By convention roles are either 'master' or 'slave'.

See Also:
Constant Field Values

DATASERVERHOST

public static final java.lang.String DATASERVERHOST
Host name of this replicator.

See Also:
Constant Field Values

UPTIME_SECONDS

public static final java.lang.String UPTIME_SECONDS
Seconds since replicator has started.

See Also:
Constant Field Values

TIME_IN_STATE_SECONDS

public static final java.lang.String TIME_IN_STATE_SECONDS
Seconds that replicator has been in its current state.

See Also:
Constant Field Values

CURRENT_TIME_MILLIS

public static final java.lang.String CURRENT_TIME_MILLIS
Current time on replicator expressed as milliseconds since Jan 1, 1970.

See Also:
Constant Field Values

STATE

public static final java.lang.String STATE
Current replicator state.

See Also:
Constant Field Values

SOURCEID

public static final java.lang.String SOURCEID
Source ID used to mark events for this replicator.

See Also:
Constant Field Values

PENDING_EXCEPTION_MESSAGE

public static final java.lang.String PENDING_EXCEPTION_MESSAGE
Current exception that caused error, if there is one.

See Also:
Constant Field Values

PENDING_ERROR_CODE

public static final java.lang.String PENDING_ERROR_CODE
Current error code, if there is one.

See Also:
Constant Field Values

PENDING_ERROR

public static final java.lang.String PENDING_ERROR
Current error, if there is one.

See Also:
Constant Field Values

PENDING_ERROR_SEQNO

public static final java.lang.String PENDING_ERROR_SEQNO
Current failed log sequence number or -1 if there is none.

See Also:
Constant Field Values

PENDING_ERROR_EVENTID

public static final java.lang.String PENDING_ERROR_EVENTID
Current failed event ID or null if there is none.

See Also:
Constant Field Values

OFFLINE_REQUESTS

public static final java.lang.String OFFLINE_REQUESTS
Pending offline requests in text form.

See Also:
Constant Field Values

RESOURCE_JDBC_URL

public static final java.lang.String RESOURCE_JDBC_URL
URL to connect to underlying data source replicator serves.

See Also:
Constant Field Values

RESOURCE_JDBC_DRIVER

public static final java.lang.String RESOURCE_JDBC_DRIVER
Class name of Java data source.

See Also:
Constant Field Values

RESOURCE_PRECEDENCE

public static final java.lang.String RESOURCE_PRECEDENCE
Resource precedence for failover, which should be an integer > 0 or -1 to indicate do not fail over to this resource.

See Also:
Constant Field Values

RESOURCE_VENDOR

public static final java.lang.String RESOURCE_VENDOR
DBMS vendor string for this data source

See Also:
Constant Field Values

RESOURCE_VIP_INTERFACE

public static final java.lang.String RESOURCE_VIP_INTERFACE
See Also:
Constant Field Values

RESOURCE_VIP_ADDRESS

public static final java.lang.String RESOURCE_VIP_ADDRESS
See Also:
Constant Field Values

RESOURCE_IS_STANDBY_DATASOURCE

public static final java.lang.String RESOURCE_IS_STANDBY_DATASOURCE
See Also:
Constant Field Values

SEQNO_TYPE

public static final java.lang.String SEQNO_TYPE
Log sequence number type to allow managers to figure out how to sort values.

See Also:
Constant Field Values

SEQNO_TYPE_LONG

public static final java.lang.String SEQNO_TYPE_LONG
Denotes a numeric log sequence number type that is convertible to a Java Long type.

See Also:
Constant Field Values

SEQNO_TYPE_STRING

public static final java.lang.String SEQNO_TYPE_STRING
Denotes a string log sequence number type whose values are comparable strings.

See Also:
Constant Field Values

MASTER_URI

public static final java.lang.String MASTER_URI
Deprecated. 
Obsolete values provided for compatibility with branched open replicator.

See Also:
Constant Field Values

DEFAULT_LATEST_EPOCH_NUMBER

public static final long DEFAULT_LATEST_EPOCH_NUMBER
See Also:
Constant Field Values

DEFAULT_LAST_EVENT_ID

public static final java.lang.String DEFAULT_LAST_EVENT_ID
See Also:
Constant Field Values
Constructor Detail

Replicator

public Replicator()
Creates a new Replicator object


Replicator

public Replicator(java.lang.String key,
                  java.lang.String clusterName,
                  java.lang.String host)
Method Detail

createFromReplicatorStatus

public static Replicator createFromReplicatorStatus(TungstenProperties replicatorProps)

getDataServiceName

public java.lang.String getDataServiceName()
Returns the dataServiceName value.

Returns:
Returns the dataServiceName.

setDataServiceName

public void setDataServiceName(java.lang.String dataServiceName)
Sets the dataServiceName value.

Parameters:
dataServiceName - The dataServiceName to set.

getHost

public java.lang.String getHost()
Returns the host value.

Returns:
Returns the host.

setHost

public void setHost(java.lang.String host)
Sets the host value.

Parameters:
host - The host to set.

getSourceId

public java.lang.String getSourceId()
Returns the sourceId value.

Returns:
Returns the sourceId.

setSourceId

public void setSourceId(java.lang.String sourceId)
Sets the sourceId value.

Parameters:
sourceId - The sourceId to set.

getVendor

public java.lang.String getVendor()
Returns the vendor value.

Returns:
Returns the vendor.

setVendor

public void setVendor(java.lang.String vendor)
Sets the vendor value.

Parameters:
vendor - The vendor to set.

getResourceJdbcDriver

public java.lang.String getResourceJdbcDriver()
Returns the resourceJdbcDriver value.

Returns:
Returns the resourceJdbcDriver.

setResourceJdbcDriver

public void setResourceJdbcDriver(java.lang.String resourceJdbcDriver)
Sets the resourceJdbcDriver value.

Parameters:
resourceJdbcDriver - The resourceJdbcDriver to set.

getRole

public java.lang.String getRole()
Returns the role value.

Returns:
Returns the role.

setRole

public void setRole(java.lang.String role)
Sets the role value.

Parameters:
role - The role to set.

isStandbyDataSource

public boolean isStandbyDataSource()
Returns the isStandbyDataSource value.

Returns:
Returns the isStandbyDataSource.

setStandbyDataSource

public void setStandbyDataSource(boolean isStandbyDataSource)
Sets the isStandbyDataSource value.

Parameters:
isStandbyDataSource - The isStandbyDataSource to set.

getResourceJdbcUrl

public java.lang.String getResourceJdbcUrl()
Returns the resourceJdbcUrl value.

Returns:
Returns the resourceJdbcUrl.

setResourceJdbcUrl

public void setResourceJdbcUrl(java.lang.String resourceJdbcUrl)
Sets the resourceJdbcUrl value.

Parameters:
resourceJdbcUrl - The resourceJdbcUrl to set.

getLatestEpochNumber

public long getLatestEpochNumber()
Returns the latestEpochNumber value.

Returns:
Returns the latestEpochNumber.

setLatestEpochNumber

public void setLatestEpochNumber(long latestEpochNumber)
Sets the latestEpochNumber value.

Parameters:
latestEpochNumber - The latestEpochNumber to set.

getAppliedLastEventId

public java.lang.String getAppliedLastEventId()
Returns the appliedLastEventId value.

Returns:
Returns the appliedLastEventId.

setAppliedLastEventId

public void setAppliedLastEventId(java.lang.String appliedLastEventId)
Sets the appliedLastEventId value.

Parameters:
appliedLastEventId - The appliedLastEventId to set.

getAppliedLatency

public double getAppliedLatency()
Returns the appliedLatency value.

Returns:
Returns the appliedLatency.

setAppliedLatency

public void setAppliedLatency(double appliedLatency)
Sets the appliedLatency value.

Parameters:
appliedLatency - The appliedLatency to set.

getVipInterface

public java.lang.String getVipInterface()
Returns the vipInterface value.

Returns:
Returns the vipInterface.

setVipInterface

public void setVipInterface(java.lang.String vipInterface)
Sets the vipInterface value.

Parameters:
vipInterface - The vipInterface to set.

getVipAddress

public java.lang.String getVipAddress()
Returns the vipAddress value.

Returns:
Returns the vipAddress.

setVipAddress

public void setVipAddress(java.lang.String vipAddress)
Sets the vipAddress value.

Parameters:
vipAddress - The vipAddress to set.

getMasterConnectUri

public java.lang.String getMasterConnectUri()
Returns the masterConnectUri value.

Returns:
Returns the masterConnectUri.

setMasterConnectUri

public void setMasterConnectUri(java.lang.String masterConnectUri)
Sets the masterConnectUri value.

Parameters:
masterConnectUri - The masterConnectUri to set.

getMasterListenUri

public java.lang.String getMasterListenUri()
Returns the masterListenUri value.

Returns:
Returns the masterListenUri.

setMasterListenUri

public void setMasterListenUri(java.lang.String masterListenUri)
Sets the masterListenUri value.

Parameters:
masterListenUri - The masterListenUri to set.

getState

public java.lang.String getState()
Returns the state value.

Returns:
Returns the state.

setState

public void setState(java.lang.String state)
Sets the state value.

Parameters:
state - The state to set.

getAppliedLastSeqno

public long getAppliedLastSeqno()
Returns the appliedLastSeqno value.

Returns:
Returns the appliedLastSeqno.

setAppliedLastSeqno

public void setAppliedLastSeqno(long appliedLastSeqno)
Sets the appliedLastSeqno value.

Parameters:
appliedLastSeqno - The appliedLastSeqno to set.