public class ReplicationMutableConfig
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
ReplicatedEnvironment
has been created. ReplicationMutableConfig
is
a parameter to Environment.setMutableConfig(com.sleepycat.je.EnvironmentMutableConfig)
and is
returned by Environment.getMutableConfig()
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALLOW_ARBITER_ACK
Boolean flag if set to true, an Arbiter may acknowledge a transaction if
a replication node is not available.
|
static java.lang.String |
DESIGNATED_PRIMARY
Identifies the Primary node in a two node group.
|
static java.lang.String |
ELECTABLE_GROUP_SIZE_OVERRIDE
An escape mechanism to modify the way in which the number of electable
nodes, and consequently the quorum requirements for elections and commit
acknowledgments, is calculated.
|
static java.lang.String |
HELPER_HOSTS
The string identifying one or more helper host and port pairs in
this format:
|
static java.lang.String |
LOG_FLUSH_TASK_INTERVAL
Deprecated.
as of 7.2. Replaced by
EnvironmentConfig.LOG_FLUSH_SYNC_INTERVAL . For compatibility with
earlier releases, if this parameter is specified its value will be used
as the flush sync interval; in this case, EnvironmentConfig.LOG_FLUSH_SYNC_INTERVAL may not also be specified. |
static java.lang.String |
NODE_PRIORITY
The election priority associated with this node.
|
static java.lang.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 java.lang.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 java.lang.String |
RUN_LOG_FLUSH_TASK
Deprecated.
as of 7.2. Log flushing can be disabled by setting
EnvironmentConfig.LOG_FLUSH_SYNC_INTERVAL and EnvironmentConfig.LOG_FLUSH_NO_SYNC_INTERVAL to zero. For compatibility
with earlier releases, if this parameter is specified as false, no log
flushing will be performed; in this case, EnvironmentConfig.LOG_FLUSH_SYNC_INTERVAL and EnvironmentConfig.LOG_FLUSH_NO_SYNC_INTERVAL may not also be specified. |
Constructor and Description |
---|
ReplicationMutableConfig()
Create a ReplicationMutableConfig initialized with the system
default settings.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getConfigParam(java.lang.String paramName)
Return the value for this parameter.
|
boolean |
getDesignatedPrimary()
Determines whether this node is the currently designated Primary.
|
int |
getElectableGroupSizeOverride()
Returns the value associated with the override.
|
java.lang.String |
getHelperHosts()
Returns the string identifying one or more helper host and port pairs in
this format:
|
int |
getNodePriority()
Returns the election priority associated with the node.
|
ReplicationMutableConfig |
setConfigParam(java.lang.String paramName,
java.lang.String value)
Set this configuration parameter with this value.
|
ReplicationMutableConfig |
setDesignatedPrimary(boolean isPrimary)
If
isPrimary is true, designate this node as a Primary. |
ReplicationMutableConfig |
setElectableGroupSizeOverride(int override)
Sets the size used to determine the number of electable nodes.
|
ReplicationMutableConfig |
setHelperHosts(java.lang.String hostsAndPorts)
Identify one or more helpers nodes by their host and port pairs in this
format:
|
ReplicationMutableConfig |
setNodePriority(int priority)
Sets the election priority for the node.
|
java.lang.String |
toString()
List the configuration parameters and values that have been set
in this configuration object.
|
public static final java.lang.String ALLOW_ARBITER_ACK
Name | Type | Mutable | Default |
"je.rep.allowArbiterAck" | Boolean | Yes | True |
public static final java.lang.String DESIGNATED_PRIMARY
Name | Type | Mutable | Default |
"je.rep.designatedPrimary" | Boolean | Yes | False |
public static final java.lang.String ELECTABLE_GROUP_SIZE_OVERRIDE
When this parameter is set to a non-zero value at a member node, the member will use this value as the electable group size, instead of using the metadata stored in the RepGroup database for its quorum calculations. This parameter's value should be set to the number of electable nodes known to be available. The default value is zero, which indicates normal operation with the electable group size being calculated from the metadata.
Please keep in mind that this is an escape mechanism, only for use in exceptional circumstances, to be used with care. Since JE HA is no longer maintaining quorum requirements automatically, there is the possibility that the simple majority of unavailable nodes could elect their own Master, which would result in a diverging set of changes to the same environment being made by multiple Masters. It is essential to ensure that the problematic nodes are in fact down before making this temporary configuration change. See the discussion in Appendix: Managing a Failure of the Majority.
Name | Type | Mutable | Default |
"je.rep.electableGroupSizeOverride" | Integer | Yes | 0 |
public static final java.lang.String NODE_PRIORITY
A priority of zero is used to ensure that this node is never elected
master, even if it has the most up to date log files. Note that the node
still votes for a Master and participates in quorum requirements. Please
use this option with care, since it means that some node with less
current log files could be elected master. As a result, this node would
be forced to rollback committed data and must be prepared to handle any
RollbackException
exceptions that might be thrown.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.node.priority" | Integer | Yes | 1 | 0 | Integer.MAX_VALUE |
RollbackException
,
Constant Field Valuespublic static final java.lang.String RUN_LOG_FLUSH_TASK
EnvironmentConfig.LOG_FLUSH_SYNC_INTERVAL
and EnvironmentConfig.LOG_FLUSH_NO_SYNC_INTERVAL
to zero. For compatibility
with earlier releases, if this parameter is specified as false, no log
flushing will be performed; in this case, EnvironmentConfig.LOG_FLUSH_SYNC_INTERVAL
and EnvironmentConfig.LOG_FLUSH_NO_SYNC_INTERVAL
may not also be specified.Durability.COMMIT_NO_SYNC
. The default for this behavior is true.
When using Durability.COMMIT_NO_SYNC
, continued activity will
naturally cause the steady flush of committed transactions, but a pause
in activity may cause the latest commits to stay in memory. In such a
case, it is unlikely but possible that all members of the replication
group have these last transactions in memory and that no members have
persisted them to disk. A catastrophic failure of all nodes in the
replication group would cause a loss of these transactions, in this
unlikely scenario. This background flush task will reduce such a
possibility.
Note that enabling this feature when using Durability.COMMIT_NO_SYNC
, does not constitute a guarantee that
updates made by a transaction are persisted. For an explicit guarantee,
transactions should use Durability.COMMIT_SYNC
or Durability.COMMIT_WRITE_NO_SYNC
. These more stringent, persistent
Durability options can be set at the environment or per-transaction
scope. Using one of these Durability settings for a given transaction
will also flush all commits that occurred earlier in time.
Name | Type | Mutable | Default |
"je.rep.runLogFlushTask" | Boolean | No | true |
public static final java.lang.String LOG_FLUSH_TASK_INTERVAL
EnvironmentConfig.LOG_FLUSH_SYNC_INTERVAL
. For compatibility with
earlier releases, if this parameter is specified its value will be used
as the flush sync interval; in this case, EnvironmentConfig.LOG_FLUSH_SYNC_INTERVAL
may not also be specified.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.logFlushTaskInterval" | Duration | Yes | 5 min | 1 s | -none- |
public static final java.lang.String REPLAY_MAX_OPEN_DB_HANDLES
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.replayMaxOpenDbHandles" | Int | Yes | 10 | 1 | -none- |
public static final java.lang.String HELPER_HOSTS
hostname[:port][,hostname[:port]]*
Name | Type | Mutable | Default |
"je.rep.helperHosts" | String | Yes | "" |
public static final java.lang.String REPLAY_DB_HANDLE_TIMEOUT
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.replayOpenHandleTimeout" | Duration | No | 30 sec | 1 sec | -none- |
public ReplicationMutableConfig()
public ReplicationMutableConfig setDesignatedPrimary(boolean isPrimary)
isPrimary
is true, designate this node as a Primary. This
setting only takes effect for electable nodes. The application must
ensure that exactly one electable node is designated to be a Primary at
any given time. Primary node configuration is only a concern when the
group has two electable nodes, and there cannot be a simple
majority. See the overview on configuring two
node groups.isPrimary
- true if this node is to be made the Primarypublic boolean getDesignatedPrimary()
public int getElectableGroupSizeOverride()
ELECTABLE_GROUP_SIZE_OVERRIDE
public ReplicationMutableConfig setElectableGroupSizeOverride(int override)
override
- the number of electable nodes. A value of zero means
that the number of electable nodes is determined as usual, that is, from
the contents of the group metadata.ELECTABLE_GROUP_SIZE_OVERRIDE
public int getNodePriority()
NODE_PRIORITY
public ReplicationMutableConfig setNodePriority(int priority)
A priority of zero is used to ensure that a node is never elected master, even if it has the most current set of files. Please use this option with caution, since it means that a node with less current log files could be elected master potentially forcing this node to rollback data that had been committed.
priority
- the priority to be associated with the node. It must be
zero, or a positive number.NODE_PRIORITY
public java.lang.String getHelperHosts()
hostname[:port][,hostname[:port]]*The port name may be omitted if it's the default port.
public ReplicationMutableConfig setHelperHosts(java.lang.String hostsAndPorts)
hostname[:port][,hostname[:port]]*If the port is omitted, the default port defined by XXX is used.
hostsAndPorts
- the string representing the host and port pairs.public ReplicationMutableConfig setConfigParam(java.lang.String paramName, java.lang.String value) throws java.lang.IllegalArgumentException
paramName
- the configuration parameter name, one of the String
constants in this classvalue
- the configuration value.java.lang.IllegalArgumentException
- if the paramName or value is invalid.public java.lang.String getConfigParam(java.lang.String paramName) throws java.lang.IllegalArgumentException
paramName
- a valid configuration parameter, one of the String
constants in this class.java.lang.IllegalArgumentException
- if the paramName is invalid.public java.lang.String toString()
toString
in class java.lang.Object
Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.