|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.tools.rumen.AbstractClusterStory
public abstract class AbstractClusterStory
AbstractClusterStory
provides a partial implementation of
ClusterStory
by parsing the topology tree.
Field Summary | |
---|---|
protected Set<MachineNode> |
machineNodes
|
protected int |
maximumDistance
|
protected Map<String,MachineNode> |
mNodeMap
|
protected MachineNode[] |
mNodesFlattened
|
protected Set<RackNode> |
rackNodes
|
protected Map<String,RackNode> |
rNodeMap
|
Constructor Summary | |
---|---|
AbstractClusterStory()
|
Method Summary | |
---|---|
protected void |
buildMachineNodeMap()
|
protected void |
buildRackNodeMap()
|
int |
distance(Node a,
Node b)
Determine the distance between two Node s. |
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.hadoop.tools.rumen.ClusterStory |
---|
getClusterTopology |
Field Detail |
---|
protected Set<MachineNode> machineNodes
protected Set<RackNode> rackNodes
protected MachineNode[] mNodesFlattened
protected Map<String,MachineNode> mNodeMap
protected Map<String,RackNode> rNodeMap
protected int maximumDistance
Constructor Detail |
---|
public AbstractClusterStory()
Method Detail |
---|
public Set<MachineNode> getMachines()
ClusterStory
getMachines
in interface ClusterStory
public Set<RackNode> getRacks()
ClusterStory
getRacks
in interface ClusterStory
public MachineNode[] getRandomMachines(int expected, Random random)
ClusterStory
getRandomMachines
in interface ClusterStory
expected
- The expected sample size.random
- Random number generator to use.
MachineNode
s.protected void buildMachineNodeMap()
public MachineNode getMachineByName(String name)
ClusterStory
MachineNode
by its host name.
getMachineByName
in interface ClusterStory
MachineNode
with the same name. Or null if not found.public int distance(Node a, Node b)
ClusterStory
Node
s. Currently, the distance
is loosely defined as the length of the longer path for either a or b to
reach their common ancestor.
distance
in interface ClusterStory
Node
a and Node
b.protected void buildRackNodeMap()
public RackNode getRackByName(String name)
ClusterStory
RackNode
by its name.
getRackByName
in interface ClusterStory
RackNode
with the same name. Or null if not found.public int getMaximumDistance()
ClusterStory
getMaximumDistance
in interface ClusterStory
protected void parseTopologyTree()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |