|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.rep.util.ReplicationGroupAdmin
public class ReplicationGroupAdmin
Administrative APIs for use by applications which do not have direct access to a replicated environment. The class supplies methods that can be used to list group members, remove members, update network addresses, and find the current master. Information is found and updated by querying nodes in the group. Because of that, ReplicationGroupAdmin can only obtain information when there is at least one node alive in the replication group.
Constructor Summary | |
---|---|
ReplicationGroupAdmin(String groupName,
Set<InetSocketAddress> helperSockets)
Constructs a group admin object. |
Method Summary | |
---|---|
ReplicationGroup |
getGroup()
Returns the current composition of the group from the Master. |
String |
getGroupName()
Returns the name of the replication group. |
Set<InetSocketAddress> |
getHelperSockets()
Returns the helper sockets being used to contact a replication group member, in order to query for the information. |
String |
getMasterNodeName()
Returns the node name associated with the master |
NodeState |
getNodeState(ReplicationNode repNode,
int socketConnectTimeout)
Returns the state of a replicated
node and state of the application where the node is
running in. |
void |
removeMember(String nodeName)
Removes this node from the group, so that it is no longer a member of the group. |
void |
updateAddress(String nodeName,
String newHostName,
int newPort)
Update the network address for a specified member of the replication group. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReplicationGroupAdmin(String groupName, Set<InetSocketAddress> helperSockets)
groupName
- the name of the group to be administeredhelperSockets
- the sockets on which it can contact helper nodes
in the replication group to carry out admin services.Method Detail |
---|
public Set<InetSocketAddress> getHelperSockets()
public String getGroupName()
public String getMasterNodeName() throws UnknownMasterException, EnvironmentFailureException
UnknownMasterException
- if the master was not found
EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.public void removeMember(String nodeName) throws UnknownMasterException, MemberNotFoundException, MasterStateException, EnvironmentFailureException
Monitor
it will no longer be informed of
election results. Once removed, a node cannot be added again to the
group under the same node name.
Ideally, the node being removed should be shut down before this call is issued.
If the node is an active Replica
the master will terminate
its connection with the node and will not allow the replica to reconnect
with the group, since it's no longer a member of the group. If the node
wishes to re-join it should do so with a different node name.
An active Master cannot be removed. It must first be shutdown, or
transition to the Replica
state before it can be removed
from the group.
nodeName
- identifies the node being removed from the group
UnknownMasterException
- if the master was not found
MemberNotFoundException
- if the node denoted by
nodeName
is not a member of the replication group
MasterStateException
- if the member being removed is currently
the Master
EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.public ReplicationGroup getGroup() throws UnknownMasterException, EnvironmentFailureException
UnknownMasterException
- if the master was not found
EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurspublic NodeState getNodeState(ReplicationNode repNode, int socketConnectTimeout) throws IOException, com.sleepycat.je.rep.utilint.ServiceDispatcher.ServiceConnectFailedException
state
of a replicated
node and state
of the application where the node is
running in.
repNode
- a ReplicationNode includes those information which are
needed to connect to the nodesocketConnectTimeout
- the timeout value for creating a socket
connection with the replicated node
IOException
- if the machine is down or no response is returned
com.sleepycat.je.rep.utilint.ServiceDispatcher.ServiceConnectFailedException
- if can't connect to the service
running on the replicated nodepublic void updateAddress(String nodeName, String newHostName, int newPort) throws EnvironmentFailureException, MasterStateException, MemberNotFoundException, ReplicaStateException, UnknownMasterException
To make a network address change, take these steps:
nodeName
- the name of the node whose address will be updated.newHostName
- the new host name of the nodenewPort
- the new port number of the node
EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs
MasterStateException
- if the member being updated is currently
the master
MemberNotFoundException
- if the node denoted by
nodeName
is not a member of the replication group
ReplicaStateException
- if the member being updated is currently
alive
UnknownMasterException
- if the master was not foundDbResetRepGroup, which can be used in a
related but different use case to copy and move a group.
|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |