|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.rep.impl.RepGroupImpl
public class RepGroupImpl
Represents a snapshot of the Replication Group as a whole. Note that membership associated with a group is dynamic and its constituents can change at any time. It's useful to keep in mind that due to the distributed nature of the Replication Group all the nodes in a replication group may not have the same consistent picture of the replication group at a single point in time, but will converge to become consistent eventually.
Nested Class Summary | |
---|---|
static class |
RepGroupImpl.BarrierState
Encapsulates the last known syncup state associated with a node. |
static class |
RepGroupImpl.NodeConflictException
|
(package private) class |
RepGroupImpl.Predicate
|
Constructor Summary | |
---|---|
RepGroupImpl(String groupName)
Constructor to create a new empty repGroup, typically as part of environment initialization. |
|
RepGroupImpl(String groupName,
boolean unknownUUID)
|
|
RepGroupImpl(String groupName,
UUID uuid,
int version,
int changeVersion,
int nodeIdSequence,
Map<Integer,RepNodeImpl> nodes)
Constructor used to recreate an existing RepGroup, typically as part of a deserialization operation. |
Method Summary | ||
---|---|---|
void |
checkForConflicts(RepNodeImpl node)
Checks for whether a new node definition is in conflict with the current members of the group. |
|
static RepGroupImpl |
deserializeHex(String[] tokens,
int start)
De-serializes an array of tokens into a Rep group object and its nodes. |
|
static RepNodeImpl |
deserializeNode(byte[] bytes)
Deserialize the mode from its byte representation. |
|
boolean |
equals(Object obj)
|
|
Set<InetSocketAddress> |
getAcceptorSockets()
Returns the sockets used by nodes running Acceptor agents, that is, just nodes which participate in elections and can become Masters. |
|
Set<RepNodeImpl> |
getAllElectableMembers()
Returns the subset of Electable nodes in the group. |
|
Set<Integer> |
getAllMemberIds()
Returns the nodes ids associated with all the nodes that are members of the group. |
|
Set<RepNodeImpl> |
getAllMembers(RepGroupImpl.Predicate p)
|
|
int |
getChangeVersion()
Returns the version of the instance as represented by changes to the members constituting the group. |
|
int |
getElectableGroupSize()
Note that even unACKed nodes are considered part of the group for group size/durability considerations. |
|
Set<RepNodeImpl> |
getElectableNodes()
|
|
static int |
getFirstNodeId()
Returns the node id that is associated with the very first node in the replication group. |
|
Set<InetSocketAddress> |
getLearnerSockets()
Return all learner sockets. |
|
RepNodeImpl |
getMember(int nodeId)
|
|
RepNodeImpl |
getMember(String name)
Lookup for existing members. |
|
Set<RepNodeImpl> |
getMonitorNodes()
Returns the monitor nodes that are members of the group. |
|
Set<InetSocketAddress> |
getMonitorSockets()
Returns the sockets used by just the Monitor nodes in the group |
|
String |
getName()
|
|
int |
getNextNodeId()
Increments the node id sequence and returns it. |
|
RepNodeImpl |
getNode(int nodeId)
Get the node, if it's present, regardless of its membership state. |
|
RepNodeImpl |
getNode(String name)
Get the node, if it's present, regardless of its membership state. |
|
int |
getNodeIdSequence()
Returns the current highest node id currently in use by the group. |
|
UUID |
getUUID()
returns the unique UUID associated with the replicated environment. |
|
int |
getVersion()
Returns the version of the representation (the schema) in use by this group instance in the database. |
|
int |
hashCode()
|
|
boolean |
hasUnknownUUID()
|
|
static RepNodeImpl |
hexDeserializeNode(String hex)
Deserializes the object serialized by serializeHex() |
|
int |
incrementChangeVersion()
Increments the object change version. |
|
static boolean |
isUnknownUUID(UUID uuid)
Predicate to help determine whether the UUID is the canonical unknown UUID. |
|
void |
makeConsistent()
Used to ensure that the ReplicationGroup value is consistent after it has been fetched via a readUncommitted access to the rep group database. |
|
(package private) static
|
objectToHex(TupleBinding<T> binding,
T object)
Serializes an object by converting its TupleBinding byte based representation into the hex characters deonoting the bytes. |
|
RepNodeImpl |
removeMember(String nodeName)
Removes a member transiently from the rep group by marking it as being deleted. |
|
static byte[] |
serializeBytes(RepNodeImpl node)
Serialize the node into its byte representation. |
|
String |
serializeHex()
Returns a serialized character based form of the group suitable for use in subclasses of SimpleProtocol. |
|
static String |
serializeHex(RepNodeImpl node)
Returns the serialized form of the node as a sequence of hex characters suitable for use by the text based protocols. |
|
void |
setNodeIdSequence(int nodeIdSequence)
Set the node id sequence. |
|
void |
setNodes(Map<Integer,RepNodeImpl> nodes)
Sets the nodes associated with the Rep group. |
|
void |
setUUID(UUID uuid)
Sets the UUID. |
|
String |
toString()
Return information to the user, format nicely for ease of reading. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RepGroupImpl(String groupName)
groupName
- public RepGroupImpl(String groupName, boolean unknownUUID)
public RepGroupImpl(String groupName, UUID uuid, int version, int changeVersion, int nodeIdSequence, Map<Integer,RepNodeImpl> nodes)
groupName
- uuid
- version
- changeVersion
- nodes
- Method Detail |
---|
public boolean hasUnknownUUID()
public static boolean isUnknownUUID(UUID uuid)
public void setUUID(UUID uuid)
public RepNodeImpl removeMember(String nodeName)
nodeName
- identifies the node being removed
EnvironmentFailureException
- if the node is not part of the grouppublic void checkForConflicts(RepNodeImpl node) throws DatabaseException, RepGroupImpl.NodeConflictException
node
- the new node that is being checked for conflicts
RepGroupImpl.NodeConflictException
- if there is a conflict
DatabaseException
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public void setNodes(Map<Integer,RepNodeImpl> nodes)
public UUID getUUID()
public int getVersion()
public int getChangeVersion()
public int incrementChangeVersion()
public int getNodeIdSequence()
public void setNodeIdSequence(int nodeIdSequence)
public int getNextNodeId()
public static int getFirstNodeId()
public void makeConsistent()
static <T> String objectToHex(TupleBinding<T> binding, T object)
T
- the type of the object being serializedbinding
- the tuble binding used to convert it into its byte formobject
- the object being serialized
public String serializeHex()
public static String serializeHex(RepNodeImpl node)
node
- the node to be serialized.
public static byte[] serializeBytes(RepNodeImpl node)
node
- the node to be serialized
public static RepNodeImpl hexDeserializeNode(String hex)
serializeHex()
hex
- the string containing the serialized form of the node
public static RepNodeImpl deserializeNode(byte[] bytes)
bytes
- the byte representation of the node.
public static RepGroupImpl deserializeHex(String[] tokens, int start)
start
represents the group object and each
subsequent token represents a node in the group.
tokens
- the array representing the group and its nodesstart
- the position in the array at which to start the
de-serialization.
public Set<Integer> getAllMemberIds()
public Set<RepNodeImpl> getAllMembers(RepGroupImpl.Predicate p)
public Set<RepNodeImpl> getAllElectableMembers()
public Set<RepNodeImpl> getElectableNodes()
public Set<RepNodeImpl> getMonitorNodes()
public Set<InetSocketAddress> getLearnerSockets()
public Set<InetSocketAddress> getMonitorSockets()
public Set<InetSocketAddress> getAcceptorSockets()
public RepNodeImpl getMember(int nodeId)
public RepNodeImpl getMember(String name) throws MemberNotFoundException
MemberNotFoundException
public RepNodeImpl getNode(int nodeId)
public RepNodeImpl getNode(String name)
public int getElectableGroupSize()
public String getName()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |