public class NodeManager extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
add(Node node)
Adds a node.
|
void |
addAddress(Endpoint addr)
Adds a RPC service address.
|
void |
clear()
Clear the states, for test
|
Node |
get(String groupId,
PeerId peerId)
Get node by groupId and peer.
|
List<Node> |
getAllNodes()
Get all nodes
|
static NodeManager |
getInstance() |
List<Node> |
getNodesByGroupId(String groupId)
Get all nodes in a raft group.
|
boolean |
remove(Node node)
Remove a node.
|
boolean |
removeAddress(Endpoint addr)
Remove a RPC service address.
|
boolean |
serverExists(Endpoint addr)
Return true when RPC service is registered.
|
public static NodeManager getInstance()
public boolean serverExists(Endpoint addr)
public boolean removeAddress(Endpoint addr)
public void addAddress(Endpoint addr)
public boolean add(Node node)
@OnlyForTest public void clear()
public boolean remove(Node node)
public List<Node> getNodesByGroupId(String groupId)
Copyright © 2021. All rights reserved.