com.sun.grid.herd
Class HerdLoadSensor

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by com.sun.grid.herd.HerdLoadSensor
All Implemented Interfaces:
LoadSensor, org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool

public class HerdLoadSensor
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool, LoadSensor

The HerdLoadSensor is a load sensor that reports the local HDFS blocks and the name of the rack. The rack name is reported twice: once as hdfs_primary_rack and once as hdfs_secondary_rack. This double reported is needed by the HerdJsv. The blocks are reported as 256 aggregate block resources named hdfs_blk*, where the * represents the first two hex digits of the block's id. Multiple blocks that share the same first two hex id digits are reported via a single block resource. Block resources for which no block is locally present are not reported.


Field Summary
 
Fields inherited from interface com.sun.grid.loadsensor.LoadSensor
MEASURE_ON_DEMAND
 
Constructor Summary
HerdLoadSensor()
           
 
Method Summary
 void doMeasurement()
           
 java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getLoadValues()
           
 int getMeasurementInterval()
           
static void main(java.lang.String[] args)
          Run this load sensor.
 int run(java.lang.String[] args)
           
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
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.conf.Configurable
getConf, setConf
 

Constructor Detail

HerdLoadSensor

public HerdLoadSensor()
Method Detail

main

public static void main(java.lang.String[] args)
Run this load sensor.

Parameters:
args - the command line arguments

run

public int run(java.lang.String[] args)
        throws java.lang.Exception
Specified by:
run in interface org.apache.hadoop.util.Tool
Throws:
java.lang.Exception

getMeasurementInterval

public int getMeasurementInterval()
Specified by:
getMeasurementInterval in interface LoadSensor

doMeasurement

public void doMeasurement()
Specified by:
doMeasurement in interface LoadSensor

getLoadValues

public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getLoadValues()
Specified by:
getLoadValues in interface LoadSensor