Package org.apache.bookkeeper.net
Interface NetworkTopology
- All Known Implementing Classes:
NetworkTopologyImpl,StabilizeNetworkTopology
public interface NetworkTopology
Network Topology Interface.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a node to the network topology.booleanCheck if the tree contains node node.intcountNumOfAvailableNodes(String scope, Collection<Node> excludedNodes) Return the number of leaves in scope but not in excludedNodes.Returns the nodes under a location.Retrieve a node from the network topology.intReturns number of racks in the network topology.voidRemove a node from network topology.
-
Field Details
-
DEFAULT_REGION
- See Also:
-
DEFAULT_RACK
- See Also:
-
DEFAULT_ZONE
- See Also:
-
DEFAULT_UPGRADEDOMAIN
- See Also:
-
DEFAULT_ZONE_AND_UPGRADEDOMAIN
- See Also:
-
DEFAULT_REGION_AND_RACK
- See Also:
-
-
Method Details
-
add
Add a node to the network topology.- Parameters:
node- add the node to network topology
-
remove
Remove a node from network topology.- Parameters:
node- remove the node from network topology
-
contains
Check if the tree contains node node.- Parameters:
node- node to check- Returns:
- true if node is already in the network topology, otherwise false.
-
getNode
Retrieve a node from the network topology.- Parameters:
loc-- Returns:
-
getNumOfRacks
int getNumOfRacks()Returns number of racks in the network topology.- Returns:
- number of racks in the network topology.
-
getLeaves
Returns the nodes under a location.- Parameters:
loc- network location- Returns:
- nodes under a location
-
countNumOfAvailableNodes
Return the number of leaves in scope but not in excludedNodes.If scope starts with ~, return the number of nodes that are not in scope and excludedNodes;
- Parameters:
scope- a path string that may start with ~excludedNodes- a list of nodes- Returns:
- number of available nodes
-