org.apache.hadoop.tools.rumen
Class MachineNode.Builder

java.lang.Object
  extended by org.apache.hadoop.tools.rumen.MachineNode.Builder
Enclosing class:
MachineNode

public static final class MachineNode.Builder
extends Object

Builder for a NodeInfo object


Constructor Summary
MachineNode.Builder(String name, int level)
          Start building a new NodeInfo object.
 
Method Summary
 MachineNode build()
          Build the MachineNode object.
 MachineNode.Builder cloneFrom(MachineNode ref)
          Clone the settings from a reference MachineNode object.
 MachineNode.Builder setMapSlots(int mapSlots)
          Set the number of map slot for the node.
 MachineNode.Builder setMemory(long memory)
          Set the physical memory of the node.
 MachineNode.Builder setMemoryPerMapSlot(long memoryPerMapSlot)
          Set the amount of RAM reserved for each map slot.
 MachineNode.Builder setMemoryPerReduceSlot(long memoryPerReduceSlot)
          Set the amount of RAM reserved for each reduce slot.
 MachineNode.Builder setNumCores(int numCores)
          Set the number of cores for the node.
 MachineNode.Builder setReduceSlots(int reduceSlots)
          Set the number of reduce slot for the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MachineNode.Builder

public MachineNode.Builder(String name,
                           int level)
Start building a new NodeInfo object.

Parameters:
name - Unique name of the node. Typically the fully qualified domain name.
Method Detail

setMemory

public MachineNode.Builder setMemory(long memory)
Set the physical memory of the node.

Parameters:
memory - Available RAM in KB.

setMapSlots

public MachineNode.Builder setMapSlots(int mapSlots)
Set the number of map slot for the node.

Parameters:
mapSlots - The number of map slots for the node.

setReduceSlots

public MachineNode.Builder setReduceSlots(int reduceSlots)
Set the number of reduce slot for the node.

Parameters:
reduceSlots - The number of reduce slots for the node.

setMemoryPerMapSlot

public MachineNode.Builder setMemoryPerMapSlot(long memoryPerMapSlot)
Set the amount of RAM reserved for each map slot.

Parameters:
memoryPerMapSlot - The amount of RAM reserved for each map slot, in KB.

setMemoryPerReduceSlot

public MachineNode.Builder setMemoryPerReduceSlot(long memoryPerReduceSlot)
Set the amount of RAM reserved for each reduce slot.

Parameters:
memoryPerReduceSlot - The amount of RAM reserved for each reduce slot, in KB.

setNumCores

public MachineNode.Builder setNumCores(int numCores)
Set the number of cores for the node.

Parameters:
numCores - Number of cores for the node.

cloneFrom

public MachineNode.Builder cloneFrom(MachineNode ref)
Clone the settings from a reference MachineNode object.

Parameters:
ref - The reference MachineNode object.

build

public MachineNode build()
Build the MachineNode object.

Returns:
The MachineNode object being built.


Copyright © 2009 The Apache Software Foundation