public class ReplicationMutableConfig extends Object implements Cloneable, 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 String |
DESIGNATED_PRIMARY
Identifies the Primary node in a two node group.
|
static 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 String |
HELPER_HOSTS
The string identifying one or more helper host and port pairs in
this format:
|
static String |
LOG_FLUSH_TASK_INTERVAL
The interval that JE HA will do a log buffer flush.
|
static String |
NODE_PRIORITY
The election priority associated with this node.
|
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 |
RUN_LOG_FLUSH_TASK
If true, JE HA (replication) will flush all committed transactions to
disk at the specified time interval.
|
Constructor and Description |
---|
ReplicationMutableConfig()
Create a ReplicationMutableConfig initialized with the system
default settings.
|
Modifier and Type | Method and Description |
---|---|
String |
getConfigParam(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.
|
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(String paramName,
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(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.
|
String |
toString()
List the configuration parameters and values that have been set
in this configuration object.
|
public static final String DESIGNATED_PRIMARY
Name | Type | Mutable | Default |
"je.rep.designatedPrimary" | Boolean | Yes | False |
public static final 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 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 String RUN_LOG_FLUSH_TASK
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 String LOG_FLUSH_TASK_INTERVAL
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.logFlushTaskInterval" | Duration | Yes | 5 min | 1 s | -none- |
public static final String REPLAY_MAX_OPEN_DB_HANDLES
Name | Type | Mutable | Default | Minimum | Maximum |
"je.rep.replayMaxOpenDbHandles" | Int | Yes | 10 | 1 | -none- |
public static final String HELPER_HOSTS
hostname[:port][,hostname[:port]]*
Name | Type | Mutable | Default |
"je.rep.helperHosts" | String | Yes | "" |
public static final 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. The
application must ensure that exactly one node is designated to be a
Primary at any given time. Primary node configuration is only a concern
when the group has two nodes, and there cannot be a simple majority. See
the overview on configuring two
node groupsisPrimary
- true if this node is to be made the Primary.public 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 String getHelperHosts()
hostname[:port][,hostname[:port]]*The port name may be omitted if it's the default port.
public ReplicationMutableConfig setHelperHosts(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(String paramName, String value) throws IllegalArgumentException
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 String getConfigParam(String paramName) throws IllegalArgumentException
paramName
- a valid configuration parameter, one of the String
constants in this class.IllegalArgumentException
- if the paramName is invalid.Copyright (c) 2004, 2014 Oracle and/or its affiliates. All rights reserved.