Berkeley DB Java Edition
version 5.0.34

com.sleepycat.je.rep
Class ReplicationConfig

java.lang.Object
  extended by com.sleepycat.je.rep.ReplicationMutableConfig
      extended by com.sleepycat.je.rep.ReplicationConfig
All Implemented Interfaces:
com.sleepycat.je.dbi.RepConfigProxy, Serializable, Cloneable

public class ReplicationConfig
extends ReplicationMutableConfig
implements com.sleepycat.je.dbi.RepConfigProxy

Specifies the immutable attributes of a replicated environment.

To change the default settings for a replicated environment, an application creates a configuration object, customizes settings and uses it for ReplicatedEnvironment construction. The set methods of this class validate the configuration values when the method is invoked. An IllegalArgumentException is thrown if the value is not valid for that attribute.

Note that ReplicationConfig only describes those attributes which must be set at ReplicatedEnvironment construction time, while its superclass ReplicationMutableConfig describes attributes that may be modified during the life of the replication group.

ReplicationConfig follows precedence rules similar to those of EnvironmentConfig.

  1. Configuration parameters specified in <environmentHome>/je.properties take first precedence.
  2. Configuration parameters set in the ReplicationConfig object used at ReplicatedEnvironment construction are next.
  3. Any configuration parameters not set by the application are set to system defaults, described along with the parameter name String constants in this class.

After a ReplicatedEnvironment has been constructed, its mutable properties may be changed using ReplicatedEnvironment#setMutableConfig. See ReplicationMutableConfig for a list of mutable properties; all other properties are immutable. Whether a property is mutable or immutable is also described along with the parameter name String constants in this class.

Getting the Current ReplicatedEnvironment Properties

To get the current "live" properties of a replicated environment after constructing it or changing its properties, you must call ReplicatedEnvironment.getRepConfig() or ReplicatedEnvironment.getRepMutableConfig(). The original ReplicationConfig or ReplicationMutableConfig object used to set the properties is not kept up to date as properties are changed, and does not reflect property validation or properties that are computed.

See Also:
Serialized Form

Field Summary
static String CONSISTENCY_POLICY
          The default consistency policy used by a replica.
static String DEFAULT_PORT
          The default port used for replication.
static String ELECTIONS_PRIMARY_RETRIES
          The number of times an unsuccessful election will be retried by a designated Primary in a two node group before it is activated and becomes the Master.
static String ELECTIONS_REBROADCAST_PERIOD
          The time interval between rebroadcasts of election results by the master node to all nodes not currently connected to it.
static String ENV_CONSISTENCY_TIMEOUT
          The amount of time to wait for a Replica to become consistent with the Master, when a ReplicatedEnvironment handle is created and no ConsistencyPolicy is specified.
static String ENV_SETUP_TIMEOUT
          The maximum amount of time for the internal housekeeping, like elections, syncup with the master, etc.
static String ENV_UNKNOWN_STATE_TIMEOUT
          Permits opening of a ReplicatedEnvironment handle in the ReplicatedEnvironment.State.UNKNOWN state, if a Master cannot be determined within this timeout period.
static String FEEDER_TIMEOUT
          A heartbeat is exchanged between the feeder and replica to ensure they are alive.
static String GROUP_NAME
          The name for the replication group.
static String HELPER_HOSTS
          The string identifying one or more helper host and port pairs in this format:
static String INSUFFICIENT_REPLICAS_TIMEOUT
          The amount of time that a Environment.beginTransaction(com.sleepycat.je.Transaction, com.sleepycat.je.TransactionConfig) on the Master will wait for a sufficient number of Replicas, as determined by the default Durability policy, to contact the Master.
static String MAX_CLOCK_DELTA
          Sets the maximum acceptable clock skew between this Replica and its Feeder, which is the node that is the source of its replication stream.
static String MAX_MESSAGE_SIZE
          The maximum message size which will be accepted by a node (to prevent DOS attacks).
static String NODE_HOST_PORT
          Names the hostname and port associated with this node in the replication group, e.g.
static String NODE_NAME
          The node name uniquely identifies this node within the replication group.
static String NODE_TYPE
          The type of this node.
static String REP_STREAM_TIMEOUT
          The maximum amount of time the replication group guarantees preservation of the log files constituting the replication stream.
static String REPLAY_DB_HANDLE_TIMEOUT
          The maximum amount of time that an inactive database handle is kept open during a replay of the replication stream.
static String REPLAY_MAX_OPEN_DB_HANDLES
          The maximum number of most recently used database handles that are kept open during the replay of the replication stream.
static String REPLAY_TXN_LOCK_TIMEOUT
          The maximum amount of time for a replay transaction to wait for a lock.
static String REPLICA_ACK_TIMEOUT
          The amount of time that the Transaction.commit(com.sleepycat.je.Durability) on the Master will wait for a sufficient number of acknowledgments from the Replicas.
static String REPLICA_TIMEOUT
          A heartbeat is exchanged between the feeder and replica to ensure they are alive.
static String TXN_ROLLBACK_LIMIT
          In rare cases, a node may need to rollback committed transactions in order to rejoin a replication group.
 
Fields inherited from class com.sleepycat.je.rep.ReplicationMutableConfig
DESIGNATED_PRIMARY, ELECTABLE_GROUP_SIZE_OVERRIDE, LOG_FLUSH_TASK_INTERVAL, NODE_PRIORITY, RUN_LOG_FLUSH_TASK
 
Constructor Summary
ReplicationConfig()
          Creates a ReplicationConfig initialized with the system default settings.
ReplicationConfig(Properties properties)
          Creates a ReplicationConfig which includes the properties specified in the properties parameter.
ReplicationConfig(String groupName, String nodeName, String hostPort)
          Creates a ReplicationConfig initialized with the system default settings and the specified group name, node name, and hostname/port values.
 
Method Summary
 ReplicationConfig clone()
          Returns a copy of this configuration object.
 ReplicaConsistencyPolicy getConsistencyPolicy()
          Returns the default consistency policy associated with the configuration.
 String getGroupName()
          Gets the name associated with the replication group.
 String getHelperHosts()
          Returns the string identifying one or more helper host and port pairs in this format:
 long getMaxClockDelta(TimeUnit unit)
          Returns the maximum acceptable clock skew between this Replica and its Feeder, which is the node that is the source of its replication stream.
 String getNodeHostname()
          Returns the hostname component of the nodeHost property.
 String getNodeHostPort()
          Returns the hostname and port associated with this node.
 String getNodeName()
          Returns the unique name associated with this node.
 int getNodePort()
          Returns the port component of the nodeHost property.
 NodeType getNodeType()
          Returns the type (ELECTABLE, MONITOR) of this node.
 long getReplicaAckTimeout(TimeUnit unit)
          Returns the configured replica timeout value.
 ProgressListener<SyncupProgress> getSyncupProgressListener()
          Return the ProgressListener to be used at this environment startup.
 ReplicationConfig setConfigParam(String paramName, String value)
          Set this configuration parameter with this value.
 ReplicationConfig setConsistencyPolicy(ReplicaConsistencyPolicy policy)
          Sets the consistency policy to be associated with the configuration.
 ReplicationConfig setGroupName(String groupName)
          Sets the name for the replication group.
 ReplicationConfig setHelperHosts(String hostsAndPorts)
          Identify one or more helpers nodes by their host and port pairs in this format:
 ReplicationConfig setMaxClockDelta(long maxClockDelta, TimeUnit unit)
          Sets the maximum acceptable clock skew between this Replica and its Feeder, which is the node that is the source of its replication stream.
 ReplicationConfig setNodeHostPort(String hostPort)
          Sets the hostname and port associated with this node.
 ReplicationConfig setNodeName(String nodeName)
          Sets the name to be associated with this node.
 ReplicationConfig setNodeType(NodeType nodeType)
          Sets the type of this node.
 ReplicationConfig setReplicaAckTimeout(long replicaCommitTimeout, TimeUnit unit)
          Set the replica commit timeout.
 ReplicationConfig setSyncupProgressListener(ProgressListener<SyncupProgress> progressListener)
          Configure the environment to make periodic calls to a ProgressListener to provide feedback on replication stream sync-up.
 
Methods inherited from class com.sleepycat.je.rep.ReplicationMutableConfig
getConfigParam, getDesignatedPrimary, getElectableGroupSizeOverride, getNodePriority, setDesignatedPrimary, setElectableGroupSizeOverride, setNodePriority, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GROUP_NAME

public static final transient String GROUP_NAME
The name for the replication group. The name must be made up of just alpha numeric characters and must not be zero length.

NameTypeMutableDefault
"je.rep.groupName" String No "DefaultGroup"

See Also:
setGroupName(java.lang.String), getGroupName(), Constant Field Values

NODE_NAME

public static final transient String NODE_NAME
The node name uniquely identifies this node within the replication group.

Note that the node name is immutable. Normally the host name should not be used as the node name, unless you intend to reuse the host name when a machine fails and is replaced, or the node is upgraded to new hardware.

NameTypeMutableDefault
"je.rep.nodeName" String No "DefaultRepNodeName"

See Also:
setNodeName(java.lang.String), getNodeName(), Constant Field Values

NODE_TYPE

public static final transient String NODE_TYPE
The type of this node.

NameTypeMutableDefault
"je.rep.nodeType" NodeType No ELECTABLE

See Also:
setNodeType(com.sleepycat.je.rep.NodeType), getNodeType(), Constant Field Values

HELPER_HOSTS

public static final transient String HELPER_HOSTS
The string identifying one or more helper host and port pairs in this format:
 hostname[:port][,hostname[:port]]*
 

NameTypeMutableDefault
"je.rep.helperHosts" String No ""

See Also:
setHelperHosts(java.lang.String), getHelperHosts(), Constant Field Values

DEFAULT_PORT

public static final transient String DEFAULT_PORT
The default port used for replication.

NameTypeMutable DefaultMinimumMaximum
"je.rep.defaultPort" Integer No 5001 1024 Short.MAX_VALUE

See Also:
Constant Field Values

NODE_HOST_PORT

public static final transient String NODE_HOST_PORT
Names the hostname and port associated with this node in the replication group, e.g. je.rep.nodeHostPort=foo.com:5001.

The hostname is defaulted to "localhost" to make it easy to prototype and to execute the examples, but the user should be very sure to set a specific hostname before starting nodes on multiple machines. The value of je.rep.nodeHostPort is saved persistently in replication group metadata and is expected to be a unique address, and a value of "localhost" in the replication metadata will cause severe communication confusion.

The port portion of the host value is optional. If it's not specified, the value of "je.rep.defaultPort" is used.

NameTypeMutableDefault
"je.rep.nodeHostPort" String No "localhost"

See Also:
setNodeHostPort(java.lang.String), getNodeHostPort(), Constant Field Values

CONSISTENCY_POLICY

public static final transient String CONSISTENCY_POLICY
The default consistency policy used by a replica. Only two policies are meaningful as properties denoting environment level default policies: NoConsistencyRequiredPolicy and TimeConsistencyPolicy. They can be specified as:
  NoConsistencyRequiredPolicy
or
  TimeConsistencyPolicy(<permissibleLag>,<timeout>)
where <permissibleLag> and <timeout> are Time Duration Properties.

For example, a time based consistency policy with a lag of one second and a timeout of one hour is denoted by the string: TimeConsistencyPolicy(1 s,1 h)

NameTypeMutableDefault
"je.rep.consistencyPolicy" String No "TimeConsistencyPolicy(1 s,1 h)"

See Also:
setConsistencyPolicy(com.sleepycat.je.ReplicaConsistencyPolicy), getConsistencyPolicy(), TransactionConfig.setConsistencyPolicy(com.sleepycat.je.ReplicaConsistencyPolicy), TransactionConfig.getConsistencyPolicy(), Time Duration Properties, Constant Field Values

REP_STREAM_TIMEOUT

public static final transient String REP_STREAM_TIMEOUT
The maximum amount of time the replication group guarantees preservation of the log files constituting the replication stream. After this period of time, nodes are free to do log cleaning and to remove log files earlier than this period. If a node has crashed and does not re-join the group within this timeout period it may need to perform a network restore operation to catch up.

NameTypeMutable DefaultMinimumMaximum
"je.rep.repStreamTimeout" Duration No 24 h 0 -none-

See Also:
Time Duration Properties, Constant Field Values

REPLAY_TXN_LOCK_TIMEOUT

public static final transient String REPLAY_TXN_LOCK_TIMEOUT
The maximum amount of time for a replay transaction to wait for a lock.

NameTypeMutable DefaultMinimumMaximum
"je.rep.replayTxnLockTimeout" Duration No 500 ms 1 ms 75 min

See Also:
Time Duration Properties, Constant Field Values

REPLAY_MAX_OPEN_DB_HANDLES

public static final transient String REPLAY_MAX_OPEN_DB_HANDLES
The maximum number of most recently used database handles that are kept open during the replay of the replication stream.

NameTypeMutable DefaultMinimumMaximum
"je.rep.replayMaxOpenDbHandles" Int No 10 1 -none-

See Also:
Constant Field Values

REPLAY_DB_HANDLE_TIMEOUT

public static final transient String REPLAY_DB_HANDLE_TIMEOUT
The maximum amount of time that an inactive database handle is kept open during a replay of the replication stream. Handles that are inactive for more than this time period are automatically closed. Note that this does not impact any handles that may have been opened by the application.

NameTypeMutable DefaultMinimumMaximum
"je.rep.replayOpenHandleTimeout" Duration No 30 sec 1 sec -none-

See Also:
Time Duration Properties, Constant Field Values

ENV_CONSISTENCY_TIMEOUT

public static final transient String ENV_CONSISTENCY_TIMEOUT
The amount of time to wait for a Replica to become consistent with the Master, when a ReplicatedEnvironment handle is created and no ConsistencyPolicy is specified. If the Replica does not become consistent within this period, a ReplicaConsistencyException is thrown by the ReplicatedEnvironment constructor.

If an explicit ConsistencyPolicy is specified via a constructor argument, then the timeout defined by the ConsistencyPolicy argument is used instead of this default.

Name Type Mutable Default Minimum Maximum
"je.rep.envConsistencyTimeout" Duration No 5 min 10 ms -none-

See Also:
Time Duration Properties, Constant Field Values

REPLICA_ACK_TIMEOUT

public static final transient String REPLICA_ACK_TIMEOUT
The amount of time that the Transaction.commit(com.sleepycat.je.Durability) on the Master will wait for a sufficient number of acknowledgments from the Replicas. If the Master does not receive a sufficient number of acknowledgments within this timeout period, the commit() will throw InsufficientAcksException. In the special case of a two node group, if this node is the designated Primary, the Primary will be activated, and the commit() will proceed normally instead of throwing an exception.

Name Type Mutable Default Minimum Maximum
"je.rep.replicaAckTimeout" Duration No 5 s 10 ms -none-

See Also:
Time Duration Properties, ReplicationMutableConfig.DESIGNATED_PRIMARY, Constant Field Values

INSUFFICIENT_REPLICAS_TIMEOUT

public static final transient String INSUFFICIENT_REPLICAS_TIMEOUT
The amount of time that a Environment.beginTransaction(com.sleepycat.je.Transaction, com.sleepycat.je.TransactionConfig) on the Master will wait for a sufficient number of Replicas, as determined by the default Durability policy, to contact the Master. If the timeout period expires before a sufficient number of Replicas contact the Master, the Environment.beginTransaction(com.sleepycat.je.Transaction, com.sleepycat.je.TransactionConfig) will throw InsufficientReplicasException. In the special case of a two node group, if this node is the designated Primary, the Primary will be activated, and the beginTransaction() will proceed normally instead of throwing an exception.

Name Type Mutable Default Minimum Maximum
"je.rep.insufficientReplicasTimeout" Duration No 10 s 10 ms -none-

See Also:
Time Duration Properties, ReplicationMutableConfig.DESIGNATED_PRIMARY, Constant Field Values

MAX_MESSAGE_SIZE

public static final transient String MAX_MESSAGE_SIZE
The maximum message size which will be accepted by a node (to prevent DOS attacks). While the default shown here is 0, it dynamically calculated when the node is created and is set to the half of the environment cache size. The cache size is mutable, but changing the cache size at run time (after environment initialization) will not change the value of this parameter. If a value other than cache size / 2 is desired, this non-mutable parameter should be specified at initialization time.

NameTypeMutable DefaultMinimumMaximum
"je.rep.maxMessageSize" Long No half of cache size 256KB Long.MAX_VALUE

See Also:
Constant Field Values

MAX_CLOCK_DELTA

public static final transient String MAX_CLOCK_DELTA
Sets the maximum acceptable clock skew between this Replica and its Feeder, which is the node that is the source of its replication stream. This value is checked whenever a Replica establishes a connection to its replication stream source. The connection is abandoned if the clock skew is larger than this value.

NameTypeMutable DefaultMinimumMaximum
"je.rep.maxClockDelta" Duration No 2 s 0 s 1 min

See Also:
setMaxClockDelta(long, java.util.concurrent.TimeUnit), getMaxClockDelta(java.util.concurrent.TimeUnit), Time Duration Properties, Constant Field Values

ELECTIONS_PRIMARY_RETRIES

public static final transient String ELECTIONS_PRIMARY_RETRIES
The number of times an unsuccessful election will be retried by a designated Primary in a two node group before it is activated and becomes the Master.

NameTypeMutable DefaultMinimumMaximum
"je.rep.electionsPrimaryRetries" Integer No 2 0 Integer.MAX_VALUE

See Also:
ReplicationMutableConfig.DESIGNATED_PRIMARY, Constant Field Values

ELECTIONS_REBROADCAST_PERIOD

public static final transient String ELECTIONS_REBROADCAST_PERIOD
The time interval between rebroadcasts of election results by the master node to all nodes not currently connected to it. These rebroadcasts help ensure that a replication group is fully restored after a network partition, by permitting nodes on either side of the resolved partition to catch up with the latest election results.

A network partition, may in some circumstances, result in a node continuing to think it is the master, even though it is on the side of the partition containing a minority of nodes, and the side with the majority has elected a new master. Rebroadcasting election results on a periodic basis ensures that the obsolete master is brought up to date after the network partition has been resolved. As a result of the update, the environment at the obsolete master is invalidated with a MasterReplicaTransitionException. The application can choose to catch this exception and re-establish the environment.

Decreasing the period will result in more frequent broadcasts and thus a faster return to normal operations after a network partition has been resolved.

Name Type Mutable Default Minimum Maximum
"je.rep.electionsRebroadcastPeriod" Duration No 1 min 1 s none

See Also:
Constant Field Values

TXN_ROLLBACK_LIMIT

public static final transient String TXN_ROLLBACK_LIMIT
In rare cases, a node may need to rollback committed transactions in order to rejoin a replication group. This parameter limits the number of transactions that may be rolled back. If the number of committed transactions targeted for rollback exceeds this parameter, a RollbackProhibitedException will be thrown.

NameTypeMutable DefaultMinimumMaximum
"je.rep.txnRollbackLimit" Integer No 10 0 Integer.MAX_VALUE

See Also:
RollbackProhibitedException, Constant Field Values

FEEDER_TIMEOUT

public static final transient String FEEDER_TIMEOUT
A heartbeat is exchanged between the feeder and replica to ensure they are alive. This is the timeout associated with the heartbeat on the feeder side of the connection.

Reducing this value enables the master to discover failed Replicas, and recycle feeder connections, faster. However, it increases the chances of false timeouts, if the network is experiencing transient problems, or the Java GC is responsible for long pauses. In the latter case, it's generally better to tune the GC to avoid such pauses.

Name Type Mutable Default Minimum Maximum
"je.rep.feederTimeout" Duration No 30 s 2 s -none-

Since:
4.0.100
See Also:
Time Duration Properties, Constant Field Values

REPLICA_TIMEOUT

public static final transient String REPLICA_TIMEOUT
A heartbeat is exchanged between the feeder and replica to ensure they are alive. This is the timeout associated with the heartbeat on the replica side of the connection.

Reducing the value means that a master failure will be discovered more promptly in some circumstances and the overall time needed to failover to a new master will be reduced. However, it increases the chances of false timeouts, if the network is experiencing transient problems, or the Java GC is responsible for long pauses. In the latter case, it's generally better to tune the GC to avoid such pauses.

Name Type Mutable Default Minimum Maximum
"je.rep.replicaTimeout" Duration No 30 s 2 s -none-

Since:
4.0.100
See Also:
Time Duration Properties, Constant Field Values

ENV_SETUP_TIMEOUT

public static final transient String ENV_SETUP_TIMEOUT
The maximum amount of time for the internal housekeeping, like elections, syncup with the master, etc. to be accomplished when opening a new handle to an environment.

This timeout does not encompass the time spent making the node consistent with the master, if it is a Replica. The timeout associated with making a replica consistent is normally determined by the ENV_CONSISTENCY_TIMEOUT parameter but can be overridden by the timeout associated with the ReplicaConsistencyPolicy if a consistencyPolicy argument was supplied to the handle constructor.

Note that the default value (10 hours) is a long time to allow for cases where elections may take a long time when other nodes are not available.

Name Type Mutable Default Minimum Maximum
"je.rep.envSetupTimeout" Duration No 10 h -none- -none-

See Also:
Time Duration Properties, Constant Field Values

ENV_UNKNOWN_STATE_TIMEOUT

public static final transient String ENV_UNKNOWN_STATE_TIMEOUT
Permits opening of a ReplicatedEnvironment handle in the ReplicatedEnvironment.State.UNKNOWN state, if a Master cannot be determined within this timeout period. For the timeout to be meaningful it must be less than ENV_SETUP_TIMEOUT.

A ReplicatedEnvironment handle in the ReplicatedEnvironment.State.UNKNOWN state can only be used to initiate read operations with an appropriately relaxed, e.g. NoConsistencyRequiredPolicy; write operations will fail with a ReplicaWriteException. The handle will transition to a Master or Replica state when it can contact a sufficient number of other nodes in the replication group.

If the parameter is set to zero, and an election cannot be concluded within the timeout defined by ENV_SETUP_TIMEOUT, the ReplicatedEnvironment constructor will throw UnknownMasterException.

Since:
5.0.33
See Also:
Constant Field Values
Name Type Mutable Default Minimum Maximum
"je.rep.envUnknownStateTimeout" Duration No 0 -none- ENV_SETUP_TIMEOUT
Constructor Detail

ReplicationConfig

public ReplicationConfig()
Creates a ReplicationConfig initialized with the system default settings. Defaults are documented with the string constants in this class.


ReplicationConfig

public ReplicationConfig(String groupName,
                         String nodeName,
                         String hostPort)
Creates a ReplicationConfig initialized with the system default settings and the specified group name, node name, and hostname/port values.

Note that the node name is immutable. Normally the host name should not be used as the node name, unless you intend to reuse the host name when a machine fails and is replaced, or the node is upgraded to new hardware.

Parameters:
groupName - the name for the replication group
nodeName - the name for this node
hostPort - the hostname and port for this node

ReplicationConfig

public ReplicationConfig(Properties properties)
                  throws IllegalArgumentException
Creates a ReplicationConfig which includes the properties specified in the properties parameter.

Parameters:
properties - Supported properties are described as the string constants in this class.
Throws:
IllegalArgumentException - If any properties read from the properties parameter are invalid.
Method Detail

getGroupName

public String getGroupName()
Gets the name associated with the replication group.

Returns:
the name of this replication group.

setGroupName

public ReplicationConfig setGroupName(String groupName)
                               throws IllegalArgumentException
Sets the name for the replication group. The name must be made up of just alpha numeric characters and must not be zero length.

Parameters:
groupName - the alpha numeric string representing the name
Returns:
this
Throws:
IllegalArgumentException - If the string name is not valid

getNodeName

public String getNodeName()
Returns the unique name associated with this node.

Returns:
the node name

setNodeName

public ReplicationConfig setNodeName(String nodeName)
                              throws IllegalArgumentException
Sets the name to be associated with this node. It must be unique within the group. When the node is instantiated and joins the replication group, a check is done to ensure that the name is unique, and a RestartRequiredException is thrown if it is not.

Note that the node name is immutable. Normally the host name should not be used as the node name, unless you intend to reuse the host name when a machine fails and is replaced, or the node is upgraded to new hardware.

Parameters:
nodeName - the node name for this replicated environment.
Returns:
this
Throws:
IllegalArgumentException

getNodeType

public NodeType getNodeType()
Returns the type (ELECTABLE, MONITOR) of this node.

Returns:
the node type

setNodeType

public ReplicationConfig setNodeType(NodeType nodeType)
Sets the type of this node.

Parameters:
nodeType - the node type
Returns:
this

getNodeHostPort

public String getNodeHostPort()
Returns the hostname and port associated with this node. The hostname and port combination are denoted by a string of the form:
   hostname:port
 

Returns:
the hostname and port string.
See Also:
NODE_HOST_PORT

setNodeHostPort

public ReplicationConfig setNodeHostPort(String hostPort)
Sets the hostname and port associated with this node. The hostname and port combination are denoted by a string of the form:
  hostname[:port]
 
The port must be outside the range of "Well Known Ports" (zero through 1023).

Parameters:
hostPort - the string containing the hostname and port as above.
Returns:
this
See Also:
NODE_HOST_PORT

getReplicaAckTimeout

public long getReplicaAckTimeout(TimeUnit unit)
Returns the configured replica timeout value.

Returns:
the timeout in milliseconds

setReplicaAckTimeout

public ReplicationConfig setReplicaAckTimeout(long replicaCommitTimeout,
                                              TimeUnit unit)
Set the replica commit timeout.

Parameters:
replicaCommitTimeout - time in milliseconds
Returns:
this

getMaxClockDelta

public long getMaxClockDelta(TimeUnit unit)
Returns the maximum acceptable clock skew between this Replica and its Feeder, which is the node that is the source of its replication stream.

Returns:
the max permissible clock skew

setMaxClockDelta

public ReplicationConfig setMaxClockDelta(long maxClockDelta,
                                          TimeUnit unit)
                                   throws IllegalArgumentException
Sets the maximum acceptable clock skew between this Replica and its Feeder, which is the node that is the source of its replication stream. This value is checked whenever a Replica establishes a connection to its replication stream source. The connection is abandoned if the clock skew is larger than this value.

Parameters:
maxClockDelta - the maximum acceptable clock skew
Returns:
this
Throws:
IllegalArgumentException - if the value is not a positive integer

getHelperHosts

public String getHelperHosts()
Returns the string identifying one or more helper host and port pairs in this format:
 hostname[:port][,hostname[:port]]*
 
The port name may be omitted if it's the default port.

Returns:
the string representing the host port pairs

setHelperHosts

public ReplicationConfig setHelperHosts(String hostsAndPorts)
Identify one or more helpers nodes by their host and port pairs in this format:
 hostname[:port][,hostname[:port]]*
 
If the port is omitted, the default port defined by XXX is used.

Parameters:
hostsAndPorts - the string representing the host and port pairs.
Returns:
this

setConsistencyPolicy

public ReplicationConfig setConsistencyPolicy(ReplicaConsistencyPolicy policy)
Sets the consistency policy to be associated with the configuration. This policy acts as the default policy used to govern the consistency requirements when starting new transactions. See the overview on consistency in replicated systems for more background.

Parameters:
policy - the consistency policy to be set for this config.
Returns:
this

getConsistencyPolicy

public ReplicaConsistencyPolicy getConsistencyPolicy()
Returns the default consistency policy associated with the configuration.

If the user does not set the default consistency policy through setConsistencyPolicy(com.sleepycat.je.ReplicaConsistencyPolicy), the system will use the policy defined by CONSISTENCY_POLICY.

Specified by:
getConsistencyPolicy in interface com.sleepycat.je.dbi.RepConfigProxy
Returns:
the consistency policy currently associated with this config.

setConfigParam

public ReplicationConfig setConfigParam(String paramName,
                                        String value)
                                 throws IllegalArgumentException
Description copied from class: ReplicationMutableConfig
Set this configuration parameter with this value. Values are validated before setting the parameter.

Overrides:
setConfigParam in class ReplicationMutableConfig
Parameters:
paramName - the configuration parameter name, one of the String constants in this class
value - the configuration value.
Returns:
this;
Throws:
IllegalArgumentException - if the paramName or value is invalid.

clone

public ReplicationConfig clone()
Returns a copy of this configuration object.


getNodeHostname

public String getNodeHostname()
Returns the hostname component of the nodeHost property.

Returns:
the hostname string

getNodePort

public int getNodePort()
Returns the port component of the nodeHost property.

Returns:
the port number

setSyncupProgressListener

public ReplicationConfig setSyncupProgressListener(ProgressListener<SyncupProgress> progressListener)
Configure the environment to make periodic calls to a ProgressListener to provide feedback on replication stream sync-up. The ProgressListener.progress() method is called at different stages of the syncup process. See SyncupProgress for information about those stages.

When using progress listeners, review the information at ProgressListener.progress(T, long, long) to avoid any unintended disruption to replication stream syncup.

Parameters:
progressListener - The ProgressListener to callback during environment instantiation (syncup).
Since:
5.0
See Also:
Replication Group Life Cycle

getSyncupProgressListener

public ProgressListener<SyncupProgress> getSyncupProgressListener()
Return the ProgressListener to be used at this environment startup.


Berkeley DB Java Edition
version 5.0.34

Copyright (c) 2004-2011 Oracle. All rights reserved.