org.apache.hadoop.tools.rumen
Class MachineNode

java.lang.Object
  extended by org.apache.hadoop.tools.rumen.Node
      extended by org.apache.hadoop.tools.rumen.MachineNode
All Implemented Interfaces:
Comparable<Node>

public final class MachineNode
extends Node

MachineNode represents the configuration of a cluster node. MachineNode should be constructed by MachineNode.Builder.


Nested Class Summary
static class MachineNode.Builder
          Builder for a NodeInfo object
 
Method Summary
 boolean addChild(Node child)
          Add a child node to this node.
 boolean equals(Object obj)
           
 int getMapSlots()
          Get the number of map slots of the node.
 long getMemory()
          Get the available physical RAM of the node.
 long getMemoryPerMapSlot()
          Get the amount of RAM reserved for each map slot.
 long getMemoryPerReduceSlot()
          Get the amount of RAM reserved for each reduce slot.
 int getNumCores()
          Get the number of cores of the node.
 RackNode getRackNode()
          Get the rack node that the machine belongs to.
 int getReduceSlots()
          Get the number of reduce slots of the node.
 int hashCode()
           
 
Methods inherited from class org.apache.hadoop.tools.rumen.Node
compareTo, getChildren, getLevel, getName, getParent, hasChildren, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

equals

public boolean equals(Object obj)
Overrides:
equals in class Node

hashCode

public int hashCode()
Overrides:
hashCode in class Node

getMemory

public long getMemory()
Get the available physical RAM of the node.

Returns:
The available physical RAM of the node, in KB.

getMapSlots

public int getMapSlots()
Get the number of map slots of the node.

Returns:
The number of map slots of the node.

getReduceSlots

public int getReduceSlots()
Get the number of reduce slots of the node.

Returns:
The number of reduce slots fo the node.

getMemoryPerMapSlot

public long getMemoryPerMapSlot()
Get the amount of RAM reserved for each map slot.

Returns:
the amount of RAM reserved for each map slot, in KB.

getMemoryPerReduceSlot

public long getMemoryPerReduceSlot()
Get the amount of RAM reserved for each reduce slot.

Returns:
the amount of RAM reserved for each reduce slot, in KB.

getNumCores

public int getNumCores()
Get the number of cores of the node.

Returns:
the number of cores of the node.

getRackNode

public RackNode getRackNode()
Get the rack node that the machine belongs to.

Returns:
The rack node that the machine belongs to. Returns null if the machine does not belong to any rack.

addChild

public boolean addChild(Node child)
Description copied from class: Node
Add a child node to this node.

Overrides:
addChild in class Node
Parameters:
child - The child node to be added. The child node should currently not be belong to another cluster topology.
Returns:
Boolean indicating whether the node is successfully added.


Copyright © 2009 The Apache Software Foundation