Package org.apache.bookkeeper.net
Interface Node
-
- All Known Implementing Classes:
BookieNode,NetworkTopologyImpl.InnerNode,NodeBase
@Beta public interface NodeThe interface defines a node in a network topology. A node may be a leave representing a data node or an inner node representing a datacenter or rack. Each data has a name and its location in the network is decided by a string with syntax similar to a file name. For example, a data node's name is hostname:port# and if it's located at rack "orange" in datacenter "dog", the string representation of its network location is /dog/orange
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetLevel()java.lang.StringgetName()java.lang.StringgetNetworkLocation()java.lang.StringgetNetworkLocation(int level)NodegetParent()voidsetLevel(int i)Set this node's level in the tree.voidsetNetworkLocation(java.lang.String location)Set this node's network location.voidsetParent(Node parent)Set this node's parent.
-
-
-
Method Detail
-
getNetworkLocation
java.lang.String getNetworkLocation(int level)
- Returns:
- the string representation of this node's network location at the specified level in the hierarchy
-
getNetworkLocation
java.lang.String getNetworkLocation()
- Returns:
- the string representation of this node's network location
-
setNetworkLocation
void setNetworkLocation(java.lang.String location)
Set this node's network location.- Parameters:
location- the location
-
getName
java.lang.String getName()
- Returns:
- this node's name
-
getParent
Node getParent()
- Returns:
- this node's parent
-
setParent
void setParent(Node parent)
Set this node's parent.- Parameters:
parent- the parent
-
getLevel
int getLevel()
- Returns:
- this node's level in the tree. E.g. the root of a tree returns 0 and its children return 1
-
setLevel
void setLevel(int i)
Set this node's level in the tree.- Parameters:
i- the level
-
-