com.sleepycat.je.rep
Class ReplicationMutableConfig

java.lang.Object
  extended by com.sleepycat.je.rep.ReplicationMutableConfig
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
ReplicationConfig

public class ReplicationMutableConfig
extends Object
implements Cloneable

Specifies the attributes that may be changed after a ReplicatedEnvironment has been created. ReplicationMutableConfig is a parameter to Environment.setMutableConfig(com.sleepycat.je.EnvironmentMutableConfig) and is returned by Environment.getMutableConfig().


Field Summary
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.
protected  Properties props
           
(package private)  boolean validateParams
           
 
Constructor Summary
ReplicationMutableConfig()
          Create a ReplicationMutableConfig initialized with the system default settings.
ReplicationMutableConfig(Properties properties, boolean validateParams)
          Used by ReplicationConfig to support construction from a property file.
 
Method Summary
protected  Object clone()
           
 void copyMutablePropsTo(ReplicationMutableConfig toConfig)
           
(package private)  void fillInEnvironmentGeneratedProps(RepImpl repImpl)
          Fills in the properties calculated by the environment to the given config object.
 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.
 int getPriority()
           
 Properties getProps()
           
 boolean getValidateParams()
           
 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.
(package private)  void setOverrideValidateParams(boolean validateParams)
          For unit testing only
 ReplicationMutableConfig setPriority(int priority)
           
 String toString()
          List the configuration parameters and values that have been set in this configuration object.
(package private)  void validateProperties(Properties checkProps)
          Validate a property bag passed in a construction time.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DESIGNATED_PRIMARY

public static final String DESIGNATED_PRIMARY
Identifies the Primary node in a two node group. See the discussion of issues when configuring two node groups

NameTypeMutableDefault
"je.rep.designatedPrimary" Boolean Yes False

See Also:
Constant Field Values

ELECTABLE_GROUP_SIZE_OVERRIDE

public static final 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. The override is accomplished by specifying the quorum size via this mutable configuration parameter.

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 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

See Also:
QuorumPolicy, Durability.ReplicaAckPolicy, Constant Field Values

props

protected Properties props

validateParams

boolean validateParams
Constructor Detail

ReplicationMutableConfig

public ReplicationMutableConfig()
Create a ReplicationMutableConfig initialized with the system default settings. Parameter defaults are documented with the string constants in this class.


ReplicationMutableConfig

ReplicationMutableConfig(Properties properties,
                         boolean validateParams)
                   throws IllegalArgumentException
Used by ReplicationConfig to support construction from a property file.

Parameters:
properties - Hold replication related properties
Throws:
IllegalArgumentException
Method Detail

fillInEnvironmentGeneratedProps

void fillInEnvironmentGeneratedProps(RepImpl repImpl)
Fills in the properties calculated by the environment to the given config object.


copyMutablePropsTo

public void copyMutablePropsTo(ReplicationMutableConfig toConfig)

setDesignatedPrimary

public ReplicationMutableConfig setDesignatedPrimary(boolean isPrimary)
If 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 groups

Parameters:
isPrimary - true if this node is to be made the Primary.
Returns:
this;

getDesignatedPrimary

public boolean getDesignatedPrimary()
Determines whether this node is the currently designated Primary. See the overview on issues around two node groups

Returns:
true if this node is a Primary, false otherwise.

getElectableGroupSizeOverride

public int getElectableGroupSizeOverride()
Returns the value associated with the override. A value of zero means that the number of electable nodes is determined as usual, that is, from the contents of the group metadata.

Returns:
the number of electable nodes as specified by the override
See Also:
ELECTABLE_GROUP_SIZE_OVERRIDE

setElectableGroupSizeOverride

public ReplicationMutableConfig setElectableGroupSizeOverride(int override)
Sets the size used to determine the number of electable nodes.

Parameters:
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.
Returns:
this
See Also:
ELECTABLE_GROUP_SIZE_OVERRIDE

getPriority

public int getPriority()

setPriority

public ReplicationMutableConfig setPriority(int priority)

setConfigParam

public ReplicationMutableConfig setConfigParam(String paramName,
                                               String value)
                                        throws IllegalArgumentException
Set this configuration parameter with this value. Values are validated before setting the parameter.

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.

getConfigParam

public String getConfigParam(String paramName)
                      throws IllegalArgumentException
Return the value for this parameter.

Parameters:
paramName - a valid configuration parameter, one of the String constants in this class.
Returns:
the configuration value.
Throws:
IllegalArgumentException - if the paramName is invalid.

validateProperties

void validateProperties(Properties checkProps)
                  throws IllegalArgumentException
Validate a property bag passed in a construction time.

Throws:
IllegalArgumentException

getProps

public Properties getProps()

toString

public String toString()
List the configuration parameters and values that have been set in this configuration object.

Overrides:
toString in class Object

setOverrideValidateParams

void setOverrideValidateParams(boolean validateParams)
For unit testing only


getValidateParams

public boolean getValidateParams()

clone

protected Object clone()
                throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException


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