public abstract class AbstractClusterStory extends Object implements ClusterStory
AbstractClusterStory provides a partial implementation of
ClusterStory by parsing the topology tree.| 限定符和类型 | 字段和说明 |
|---|---|
protected Set<MachineNode> |
machineNodes |
protected int |
maximumDistance |
protected Map<String,MachineNode> |
mNodeMap |
protected MachineNode[] |
mNodesFlattened |
protected Set<RackNode> |
rackNodes |
protected Map<String,RackNode> |
rNodeMap |
| 构造器和说明 |
|---|
AbstractClusterStory() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
buildMachineNodeMap() |
protected void |
buildRackNodeMap() |
int |
distance(Node a,
Node b)
Determine the distance between two
Nodes. |
MachineNode |
getMachineByName(String name)
Get
MachineNode by its host name. |
Set<MachineNode> |
getMachines()
Get all machines of the cluster.
|
int |
getMaximumDistance()
Get the maximum distance possible between any two nodes.
|
RackNode |
getRackByName(String name)
Get
RackNode by its name. |
Set<RackNode> |
getRacks()
Get all racks of the cluster.
|
MachineNode[] |
getRandomMachines(int expected,
Random random)
Select a random set of machines.
|
protected void |
parseTopologyTree() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetClusterTopologyprotected Set<MachineNode> machineNodes
protected MachineNode[] mNodesFlattened
protected Map<String,MachineNode> mNodeMap
protected int maximumDistance
public Set<MachineNode> getMachines()
ClusterStorygetMachines 在接口中 ClusterStorypublic Set<RackNode> getRacks()
ClusterStorygetRacks 在接口中 ClusterStorypublic MachineNode[] getRandomMachines(int expected, Random random)
ClusterStorygetRandomMachines 在接口中 ClusterStoryexpected - The expected sample size.random - Random number generator to use.MachineNodes.protected void buildMachineNodeMap()
public MachineNode getMachineByName(String name)
ClusterStoryMachineNode by its host name.getMachineByName 在接口中 ClusterStoryMachineNode with the same name. Or null if not found.public int distance(Node a, Node b)
ClusterStoryNodes. Currently, the distance
is loosely defined as the length of the longer path for either a or b to
reach their common ancestor.distance 在接口中 ClusterStoryNode a and Node b.protected void buildRackNodeMap()
public RackNode getRackByName(String name)
ClusterStoryRackNode by its name.getRackByName 在接口中 ClusterStoryRackNode with the same name. Or null if not found.public int getMaximumDistance()
ClusterStorygetMaximumDistance 在接口中 ClusterStoryprotected void parseTopologyTree()
Copyright © 2009 The Apache Software Foundation