org.apache.hadoop.tools.rumen
Interface ClusterStory

All Known Implementing Classes:
AbstractClusterStory, ZombieCluster

public interface ClusterStory

ClusterStory represents all configurations of a MapReduce cluster, including nodes, network topology, and slot configurations.


Method Summary
 int distance(Node a, Node b)
          Determine the distance between two Nodes.
 Node getClusterTopology()
          Get the cluster topology tree.
 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.
 

Method Detail

getMachines

Set<MachineNode> getMachines()
Get all machines of the cluster.

Returns:
A read-only set that contains all machines of the cluster.

getRacks

Set<RackNode> getRacks()
Get all racks of the cluster.

Returns:
A read-only set that contains all racks of the cluster.

getClusterTopology

Node getClusterTopology()
Get the cluster topology tree.

Returns:
The root node of the cluster topology tree.

getRandomMachines

MachineNode[] getRandomMachines(int expected,
                                Random random)
Select a random set of machines.

Parameters:
expected - The expected sample size.
random - Random number generator to use.
Returns:
An array of up to expected number of MachineNodes.

getMachineByName

MachineNode getMachineByName(String name)
Get MachineNode by its host name.

Returns:
The MachineNode with the same name. Or null if not found.

getRackByName

RackNode getRackByName(String name)
Get RackNode by its name.

Returns:
The RackNode with the same name. Or null if not found.

distance

int distance(Node a,
             Node b)
Determine the distance between two Nodes. Currently, the distance is loosely defined as the length of the longer path for either a or b to reach their common ancestor.

Parameters:
a -
b -
Returns:
The distance between Node a and Node b.

getMaximumDistance

int getMaximumDistance()
Get the maximum distance possible between any two nodes.

Returns:
the maximum distance possible between any two nodes.


Copyright © 2009 The Apache Software Foundation