public class RepGroupDB
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RepGroupDB.GroupBinding |
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 java.lang.String |
GROUP_KEY |
static DatabaseEntry |
groupKeyEntry |
(package private) static TransactionConfig |
READ_ONLY |
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.
|
(package private) void |
ensureMember(RepNodeImpl ensureNode) |
static RepGroupImpl |
getGroup(java.io.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,
java.lang.String groupName,
ReplicaConsistencyPolicy policy)
Returns all the members that are currently part of the replication
group.
|
RepGroupImpl |
getGroup(ReplicaConsistencyPolicy policy) |
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)
Deletes a node from the replication group by marking it as such in the
rep group db.
|
boolean |
updateLocalCBVLSN(NameIdPair nameIdPair,
VLSN newCBVLSN)
Updates the database entry associated with the node with the new local
CBVLSN, if it can do so without encountering lock contention.
|
void |
updateMember(RepNodeImpl node) |
public final RepGroupImpl emptyGroup
public static final java.lang.String GROUP_KEY
public static final DatabaseEntry groupKeyEntry
public static final long DB_ID
static final TransactionConfig READ_ONLY
public RepGroupDB(RepImpl repImpl) throws DatabaseException, java.io.IOException
java.io.IOException
DatabaseException
public static RepGroupImpl getGroup(RepImpl rImpl, java.lang.String groupName, ReplicaConsistencyPolicy policy) throws DatabaseException
policy
- determines how current the information must be if it's
invoked on a Replica.DatabaseException
- if the object could not be obtainedpublic RepGroupImpl getGroup(ReplicaConsistencyPolicy policy) throws DatabaseException
DatabaseException
public void addFirstNode() throws DatabaseException
DatabaseException
public void ensureMember(Protocol.NodeGroupInfo membershipInfo) throws InsufficientReplicasException, InsufficientAcksException, DatabaseException
membershipInfo
- provided by the replicaInsufficientReplicasException
- upon failure of 2p member updateDatabaseException
- when the membership info could not be entered
into the membership database.InsufficientAcksException
void ensureMember(RepNodeImpl ensureNode) throws DatabaseException
DatabaseException
public void removeMember(RepNodeImpl removeNode)
public void updateMember(RepNodeImpl node) throws InsufficientReplicasException, InsufficientAcksException, DatabaseException
public boolean updateLocalCBVLSN(NameIdPair nameIdPair, VLSN newCBVLSN) throws DatabaseException
nameIdPair
- identifies the node being updatednewCBVLSN
- the new local CBVLSN to be associated with the node.DatabaseException
public static RepGroupImpl getGroup(java.io.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 (c) 2004-2012 Oracle. All rights reserved.