public class ReplicationConfig extends ReplicationMutableConfig implements com.sleepycat.je.dbi.RepConfigProxy
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
.
ReplicatedEnvironment
construction are next.
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.
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.Modifier and Type | Field and Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
static String |
ALLOW_UNKNOWN_STATE_ENV_OPEN
Deprecated.
For internal use only.
When set to
true , it permits opening of a
ReplicatedEnvironment handle in the ReplicatedEnvironment.State.UNKNOWN state, if a Master could not be
determined within the timeout specified by ENV_SETUP_TIMEOUT . If it's false, an
UnknownMasterException exception is thrown upon expiration of
the timeout.
A ReplicatedEnvironment handle in the
|
||||||||
static String |
ARBITER_OUTPUT_QUEUE_SIZE
The size of the the queue used to hold commit records that the Feeder
uses to request acknowledgment from an Arbiter.
|
||||||||
static String |
ARBITER_USE |
||||||||
static String |
BIND_INADDR_ANY
When this configuration parameter is set to true, it binds the HA socket
to INADDR_ANY, so that HA services are available on all network
interfaces.
|
||||||||
static String |
CONSISTENCY_POLICY
The default consistency policy used by a replica.
|
||||||||
static ReplicationConfig |
DEFAULT |
||||||||
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
Deprecated.
replaced by
ReplicationMutableConfig.HELPER_HOSTS . |
||||||||
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 electable 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 |
PROTOCOL_OLD_STRING_ENCODING
When set to
true , which is currently the default, the
replication network protocol will use the JVM platform default charset
(text encoding) for node names and host names. |
||||||||
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_COST_PERCENT
The cost of replaying the replication stream as compared to the cost of
performing a network restore, represented as a percentage.
|
||||||||
static String |
REPLAY_DB_HANDLE_TIMEOUT
Deprecated.
replaced by
ReplicationMutableConfig.REPLAY_DB_HANDLE_TIMEOUT . |
||||||||
static String |
REPLAY_FREE_DISK_PERCENT
The amount of free disk space that should be maintained when deciding
whether to retain log files for use in replaying the replication stream,
specified as a percentage of the total disk space.
|
||||||||
static String |
REPLAY_MAX_OPEN_DB_HANDLES
Deprecated.
replaced by
ReplicationMutableConfig.REPLAY_MAX_OPEN_DB_HANDLES . |
||||||||
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
electable Replicas. |
||||||||
static String |
REPLICA_GROUP_COMMIT_INTERVAL
The time interval during which transactions may be grouped to amortize
the cost of fsync when a transaction commits with SyncPolicy#SYNC on the
Replica.
|
||||||||
static String |
REPLICA_MAX_GROUP_COMMIT
The maximum number of transactions that can be grouped to amortize the
cost of an fsync when a transaction commits with SyncPolicy#SYNC on the
Replica.
|
||||||||
static String |
REPLICA_RECEIVE_BUFFER_SIZE
The size of the the TCP receive buffer associated with the socket used
by the replica to transfer the replication stream.
|
||||||||
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.
|
ALLOW_ARBITER_ACK, CATCHUP_MASTER_TIMEOUT, DESIGNATED_PRIMARY, ELECTABLE_GROUP_SIZE_OVERRIDE, LOG_FLUSH_TASK_INTERVAL, NODE_PRIORITY, props, RUN_LOG_FLUSH_TASK
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Set<InetSocketAddress> |
getHelperSockets() |
LogFileRewriteListener |
getLogFileRewriteListener() |
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.
|
InetSocketAddress |
getNodeSocketAddress() |
NodeType |
getNodeType()
Returns the
NodeType of this node. |
long |
getReplicaAckTimeout(TimeUnit unit)
Returns the configured replica timeout value.
|
ReplicationNetworkConfig |
getRepNetConfig() |
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.
|
void |
setConsistencyPolicyVoid(ReplicaConsistencyPolicy policy) |
ReplicationConfig |
setGroupName(String groupName)
Sets the name for the replication group.
|
void |
setGroupNameVoid(String groupName) |
ReplicationConfig |
setLogFileRewriteListener(LogFileRewriteListener listener) |
void |
setLogFileRewriteListenerVoid(LogFileRewriteListener l) |
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.
|
void |
setMaxClockDeltaVoid(long maxClockDelta,
TimeUnit unit) |
ReplicationConfig |
setNodeHostPort(String hostPort)
Sets the hostname and port associated with this node.
|
void |
setNodeHostPortVoid(String hostPort) |
ReplicationConfig |
setNodeName(String nodeName)
Sets the name to be associated with this node.
|
void |
setNodeNameVoid(String nodeName) |
ReplicationConfig |
setNodeType(NodeType nodeType)
Sets the type of this node.
|
void |
setNodeTypeVoid(NodeType nodeType) |
ReplicationConfig |
setReplicaAckTimeout(long replicaAckTimeout,
TimeUnit unit)
Set the replica commit timeout.
|
void |
setReplicaAckTimeoutVoid(long replicaAckTimeout,
TimeUnit unit) |
ReplicationConfig |
setRepNetConfig(ReplicationNetworkConfig netConfig) |
void |
setRepNetConfigVoid(ReplicationNetworkConfig netConfig) |
ReplicationConfig |
setSyncupProgressListener(ProgressListener<SyncupProgress> progressListener)
Configure the environment to make periodic calls to a
ProgressListener to provide feedback on replication stream sync-up. |
void |
setSyncupProgressListenerVoid(ProgressListener<SyncupProgress> progressListener) |
void |
verify() |
copyMutablePropsTo, getConfigParam, getDesignatedPrimary, getElectableGroupSizeOverride, getHelperHosts, getNodePriority, getProps, getValidateParams, setDesignatedPrimary, setDesignatedPrimaryVoid, setElectableGroupSizeOverride, setElectableGroupSizeOverrideVoid, setHelperHosts, setHelperHostsVoid, setNodePriority, setNodePriorityVoid, toString
public static final String GROUP_NAME
Name | Type | Mutable | Default |
"je.rep.groupName" | String | No | "DefaultGroup" |
public static final String NODE_NAME
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.
Name | Type | Mutable | Default |
"je.rep.nodeName" | String | No | "DefaultRepNodeName" |
public static final String NODE_TYPE
Name | Type | Mutable | Default |
"je.rep.nodeType" | NodeType |
No | ELECTABLE |
@Deprecated public static final String HELPER_HOSTS
ReplicationMutableConfig.HELPER_HOSTS
.hostname[:port][,hostname[:port]]*
Name | Type | Mutable | Default |
"je.rep.helperHosts" | String | No | "" |
public static final String DEFAULT_PORT
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.defaultPort" | Integer | No | 5001 | 1024 | Short.MAX_VALUE |
public static final String NODE_HOST_PORT
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.
Name | Type | Mutable | Default |
"je.rep.nodeHostPort" | String | No | "localhost" |
public static final String BIND_INADDR_ANY
NODE_HOST_PORT
configuration.
Name | Type | Mutable | Default |
"je.rep.bindInaddrAny" | Boolean | No | false |
public static final String CONSISTENCY_POLICY
NoConsistencyRequiredPolicy
and
TimeConsistencyPolicy
. They
can be specified as:
NoConsistencyRequiredPolicyor
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)
Name | Type | Mutable | Default |
"je.rep.consistencyPolicy" | String | No | "TimeConsistencyPolicy(1 s,1 h)" |
public static final String REP_STREAM_TIMEOUT
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.repStreamTimeout" | Duration | No | 30 m | 0 | -none- |
public static final String REPLAY_COST_PERCENT
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.replayCostPercent" | Integer | No | 150 | 0 | 200 |
REPLAY_FREE_DISK_PERCENT
,
Constant Field Valuespublic static final String REPLAY_FREE_DISK_PERCENT
REPLAY_COST_PERCENT
parameter if retaining the files would reduce free
space below the specified percentage. If the value is 0, then the
parameter is disabled, and decisions about which log files to remove
will not consider the amount of free disk space. This parameter only
has an effect when running with Java 7 or later.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.replayFreeDiskPercent" | Integer | No | 10 | 0 | 99 |
REPLAY_COST_PERCENT
,
Constant Field Valuespublic static final String REPLAY_TXN_LOCK_TIMEOUT
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.replayTxnLockTimeout" | Duration | No | 500 ms | 1 ms | 75 min |
@Deprecated public static final String REPLAY_MAX_OPEN_DB_HANDLES
ReplicationMutableConfig.REPLAY_MAX_OPEN_DB_HANDLES
.Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.replayMaxOpenDbHandles" | Int | Yes | 10 | 1 | -none- |
@Deprecated public static final String REPLAY_DB_HANDLE_TIMEOUT
ReplicationMutableConfig.REPLAY_DB_HANDLE_TIMEOUT
.Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.replayOpenHandleTimeout" | Duration | Yes | 30 sec | 1 sec | -none- |
public static final String ENV_CONSISTENCY_TIMEOUT
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- |
public static final String REPLICA_ACK_TIMEOUT
Transaction.commit(com.sleepycat.je.Durability)
on the Master will wait for a sufficient number of acknowledgments from
electable 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- |
public static final String INSUFFICIENT_REPLICAS_TIMEOUT
Environment.beginTransaction(com.sleepycat.je.Transaction, com.sleepycat.je.TransactionConfig)
on the Master will wait for a sufficient number of electable 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- |
public static final String MAX_MESSAGE_SIZE
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.maxMessageSize" | Long | No | half of cache size | 256KB | Long.MAX_VALUE |
public static final String MAX_CLOCK_DELTA
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.maxClockDelta" | Duration | No | 2 s | 0 s | 1 min |
public static final String ELECTIONS_PRIMARY_RETRIES
Primary
in a two node group before it is
activated and becomes the Master.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.electionsPrimaryRetries" | Integer | No | 2 | 0 | Integer.MAX_VALUE |
public static final String ELECTIONS_REBROADCAST_PERIOD
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 electable 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 will transition into a replica state.
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 |
public static final String TXN_ROLLBACK_LIMIT
RollbackProhibitedException
will be thrown.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.txnRollbackLimit" | Integer | No | 10 | 0 | Integer.MAX_VALUE |
RollbackProhibitedException
,
Constant Field Valuespublic static final String FEEDER_TIMEOUT
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- |
public static final String REPLICA_TIMEOUT
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- |
public static final String REPLICA_RECEIVE_BUFFER_SIZE
Larger values help handle incoming network traffic even when the replica has been paused for a garbage collection. The parameter default value of 1 MB should be sufficient in most of the environments. Consider increasing the value if network monitoring shows packet loss, or if your JE environment contains large data values. Note that if the size specified is larger than the operating system constrained maximum, it will be limited to this maximum value. For example, on Linux you may need to set the kernel parameter: net.core.rmem_max property using the command: sysctl -w net.core.rmem_max=1048576 to increase the operating system imposed limit.
A parameter value of zero will result in the use of operating system specified default socket buffer size.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.replicaReceiveBufferSize" | Integer | No | 1048576 | 0 | -none- |
public static final String REPLICA_MAX_GROUP_COMMIT
Specifying larger values can result in more transactions being grouped together decreasing average commit times.
An fsync is issued if the size of the transaction group reaches the
maximum within the time period specified by
REPLICA_GROUP_COMMIT_INTERVAL
.
The ReplicatedEnvironmentStats.getNReplayGroupCommitMaxExceeded()
statistic may be used to tune this parameter. Large values indicate that
commit throughput could be improved by increasing the current value.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.replicaMaxGroupCommit" | Integer | No | 200 | 0 | -none- |
REPLICA_GROUP_COMMIT_INTERVAL
,
Constant Field Valuespublic static final String REPLICA_GROUP_COMMIT_INTERVAL
group commit size
is greater than one.
The first (as ordered by transaction serialization) transaction in a transaction group may be delayed by at most this amount. Subsequent transactions in the group will have smaller delays since they are later in the serialization order.
The ReplicatedEnvironmentStats.getNReplayGroupCommitTimeouts()
statistic may be used to tune this parameter. Large numbers of timeouts
in conjunction with large numbers of group commits (
ReplicatedEnvironmentStats.getNReplayGroupCommits()
) indicate
that commit throughput could be improved by increasing the time
interval.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.replicaGroupCommitInterval" | Duration | No | 3 ms | 0 | -none- |
REPLICA_MAX_GROUP_COMMIT
,
Constant Field Valuespublic static final String ENV_SETUP_TIMEOUT
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- |
@Deprecated public static final String ALLOW_UNKNOWN_STATE_ENV_OPEN
true
, it permits opening of a
ReplicatedEnvironment handle in the ReplicatedEnvironment.State.UNKNOWN
state, if a Master could not be
determined within the timeout specified by ENV_SETUP_TIMEOUT
. If it's false, an
UnknownMasterException
exception is thrown upon expiration of
the timeout.
A ReplicatedEnvironment handle in the ReplicatedEnvironment.State.UNKNOWN
state can only be used to initiate
read operations with an appropriately relaxed 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.
Name | Type | Mutable | Default |
"je.rep.allowUnknownStateEnvOpen" | Boolean | No | False |
public static final String ENV_UNKNOWN_STATE_TIMEOUT
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
. This parameter is
ignored when creating a replicated environment for the first time.
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
.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.envUnknownStateTimeout" | Duration | No | 0 | -none- | ENV_SETUP_TIMEOUT |
Name | Type | Mutable | Default |
"je.rep.protocolOldStringEncoding" | Boolean | No | True |
public static final String ARBITER_USE
public static final String ARBITER_OUTPUT_QUEUE_SIZE
An entry is attempted to be put on the queue. If it cannot be done within a certain amount of time, the transaction will fail due to insufficient acks.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.arbiterOutputQueueSize" | Integer | No | 4096 | 0 | -none- |
public static final ReplicationConfig DEFAULT
public ReplicationConfig()
public ReplicationConfig(String groupName, String nodeName, String hostPort)
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.
groupName
- the name for the replication groupnodeName
- the name for this nodehostPort
- the hostname and port for this nodesetGroupName(java.lang.String)
,
setNodeName(java.lang.String)
public ReplicationConfig(Properties properties) throws IllegalArgumentException
properties
- Supported properties are described as the string
constants in this class.IllegalArgumentException
- If any properties read from the
properties parameter are invalid.public String getGroupName()
public ReplicationConfig setGroupName(String groupName) throws IllegalArgumentException
The name should consist of letters, digits, and/or hyphen ("-"), underscore ("_"), or period (".").
groupName
- the string representing the nameIllegalArgumentException
- If the string name is not validpublic void setGroupNameVoid(String groupName) throws IllegalArgumentException
IllegalArgumentException
public String getNodeName()
public ReplicationConfig setNodeName(String nodeName) throws IllegalArgumentException
RestartRequiredException
is thrown if it is not.
The name should consist of letters, digits, and/or hyphen ("-"), underscore ("_"), or period (".").
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.
nodeName
- the node name for this replicated environment.IllegalArgumentException
- If the name is not validpublic void setNodeNameVoid(String nodeName) throws IllegalArgumentException
IllegalArgumentException
public ReplicationConfig setNodeType(NodeType nodeType)
nodeType
- the node typepublic void setNodeTypeVoid(NodeType nodeType)
public String getNodeHostPort()
hostname:port
NODE_HOST_PORT
public ReplicationConfig setNodeHostPort(String hostPort)
hostname[:port]The port must be outside the range of "Well Known Ports" (zero through 1023).
hostPort
- the string containing the hostname and port as above.NODE_HOST_PORT
public void setNodeHostPortVoid(String hostPort)
public long getReplicaAckTimeout(TimeUnit unit)
public ReplicationConfig setReplicaAckTimeout(long replicaAckTimeout, TimeUnit unit)
replicaAckTimeout
- time in millisecondspublic void setReplicaAckTimeoutVoid(long replicaAckTimeout, TimeUnit unit)
public long getMaxClockDelta(TimeUnit unit)
public ReplicationConfig setMaxClockDelta(long maxClockDelta, TimeUnit unit) throws IllegalArgumentException
maxClockDelta
- the maximum acceptable clock skewIllegalArgumentException
- if the value is not a positive integerpublic void setMaxClockDeltaVoid(long maxClockDelta, TimeUnit unit) throws IllegalArgumentException
IllegalArgumentException
public ReplicationConfig setConsistencyPolicy(ReplicaConsistencyPolicy policy)
policy
- the consistency policy to be set for this config.public void setConsistencyPolicyVoid(ReplicaConsistencyPolicy policy)
public ReplicaConsistencyPolicy getConsistencyPolicy()
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
.
getConsistencyPolicy
in interface com.sleepycat.je.dbi.RepConfigProxy
public ReplicationConfig setConfigParam(String paramName, String value) throws IllegalArgumentException
ReplicationMutableConfig
setConfigParam
in class ReplicationMutableConfig
paramName
- the configuration parameter name, one of the String
constants in this classvalue
- the configuration value.IllegalArgumentException
- if the paramName or value is invalid.public ReplicationNetworkConfig getRepNetConfig()
public ReplicationConfig setRepNetConfig(ReplicationNetworkConfig netConfig)
netConfig
- the new ReplicationNetworkConfig to be associated
with this ReplicationConfig. This must not be null.IllegalArgumentException
- if the netConfig is nullpublic void setRepNetConfigVoid(ReplicationNetworkConfig netConfig)
public ReplicationConfig clone()
clone
in class ReplicationMutableConfig
public Set<InetSocketAddress> getHelperSockets()
public InetSocketAddress getNodeSocketAddress()
public String getNodeHostname()
public int getNodePort()
public ReplicationConfig setSyncupProgressListener(ProgressListener<SyncupProgress> progressListener)
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.
progressListener
- The ProgressListener to callback during
environment instantiation (syncup).public void setSyncupProgressListenerVoid(ProgressListener<SyncupProgress> progressListener)
public ProgressListener<SyncupProgress> getSyncupProgressListener()
public ReplicationConfig setLogFileRewriteListener(LogFileRewriteListener listener)
public void setLogFileRewriteListenerVoid(LogFileRewriteListener l)
public LogFileRewriteListener getLogFileRewriteListener()
public void verify() throws IllegalArgumentException
IllegalArgumentException
Copyright (c) 2002, 2015 Oracle and/or its affiliates. All rights reserved.