public class RepGroupDB extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RepGroupDB.GroupBinding
RepGroupImpl version 3: Add the minJEVersion field
|
static class |
RepGroupDB.NodeBinding
Supports the serialization/deserialization of node info into and out of
the database.
|
| Modifier and Type | Field and Description |
|---|---|
static long |
DB_ID |
RepGroupImpl |
emptyGroup |
static String |
GROUP_KEY |
static DatabaseEntry |
groupKeyEntry |
| Constructor and Description |
|---|
RepGroupDB(RepImpl repImpl)
Create an instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFirstNode()
Ensures that information about this node, the current master, is in the
member database.
|
void |
ensureMember(Protocol.NodeGroupInfo membershipInfo)
Ensures that the membership info for the replica is in the database.
|
RepGroupImpl |
getGroup() |
static RepGroupImpl |
getGroup(File envDir)
An internal API used to obtain group information by opening a stand
alone environment handle and reading the RepGroupDB.
|
static RepGroupImpl |
getGroup(RepImpl rImpl,
String groupName)
Returns all the members that are currently part of the replication
group, using NO_CONSISTENCY.
|
void |
reinitFirstNode(VLSN lastOldVLSN)
Deletes all the current members from the rep group database and creates
a new group, with just the member supplied via the configuration.
|
void |
removeMember(RepNodeImpl removeNode,
boolean delete)
Removes a node from the replication group by marking the node's entry in
the rep group db as removed, and optionally deleting the entry.
|
void |
setMinJEVersion(JEVersion newMinJEVersion)
Sets the minimum JE version required for nodes to join the replication
group and refreshes the group object cached in the rep group.
|
boolean |
updateLocalCBVLSN(NameIdPair nameIdPair,
VLSN newCBVLSN,
NodeType nodeType)
This method is not used when the CBVLSN is defunct -- see GlobalCBVLSN.
|
void |
updateMember(RepNodeImpl node,
boolean quorumAck) |
public final RepGroupImpl emptyGroup
public static final String GROUP_KEY
public static final DatabaseEntry groupKeyEntry
public static final long DB_ID
public RepGroupDB(RepImpl repImpl) throws DatabaseException
DatabaseExceptionpublic static RepGroupImpl getGroup(RepImpl rImpl, String groupName) throws DatabaseException
DatabaseException - if the object could not be obtainedpublic RepGroupImpl getGroup() throws DatabaseException
DatabaseExceptionpublic void setMinJEVersion(JEVersion newMinJEVersion) throws DatabaseException, MinJEVersionUnsupportedException
MinJEVersionUnsupportedException if the requested version is not
supported by current nodes.
If this method returns successfully, nodes that are running a JE version older than the one specified will not be permitted to join the replication group in the future. Use this method to implement features that require all group members to meet a minimum version requirement.
The update attempts to obtain acknowledgments from a simple majority, to make sure that future masters agree that the update has taken place, but does not require this.
newMinJEVersion - the new minimum JE versionDatabaseException - if an error occurs when accessing the
replication group databaseMinJEVersionUnsupportedException - if the requested version is not
supportedpublic void addFirstNode()
throws DatabaseException
Note that this overloading is only used by a node that is the master.
DatabaseExceptionpublic void ensureMember(Protocol.NodeGroupInfo membershipInfo) throws DatabaseException
This method should not be called for nodes with transient IDs.
membershipInfo - provided by the replicaInsufficientReplicasException - upon failure of 2p member updateInsufficientAcksException - upon failure of 2p member updateDatabaseException - when the membership info could not be entered
into the membership database.public void removeMember(RepNodeImpl removeNode, boolean delete)
This method should not be called for nodes with transient IDs.
public void updateMember(RepNodeImpl node, boolean quorumAck) throws DatabaseException
DatabaseExceptionpublic boolean updateLocalCBVLSN(NameIdPair nameIdPair, VLSN newCBVLSN, NodeType nodeType) throws DatabaseException
nameIdPair - identifies the node being updatednewCBVLSN - the new local CBVLSN to be associated with the node.nodeType - the node type of the RepNodeDatabaseExceptionpublic static RepGroupImpl getGroup(File envDir)
envDir - the directory containing the environment log filespublic void reinitFirstNode(VLSN lastOldVLSN)
DbResetRepGroup
The changes proceed in three steps: 1) Determine the node id sequence number. This is to ensure that rep node ids are not reused. Old rep node ids are present in the logs as commit records. 2) A new group object, with the node id sequence number determined in step 1), is created and all existing nodes are deleted. 3) The first node is added to the rep group.
lastOldVLSN - the VLSN used to associate the new barrier wrt this
node.Copyright © 2024. All rights reserved.