org.apache.hadoop.examples.pi
Class DistSum

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.hadoop.examples.pi.DistSum
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool

public final class DistSum
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool

The main class for computing sums using map/reduce jobs. A sum is partitioned into jobs. A job may be executed on the map-side or on the reduce-side. A map-side job has multiple maps and zero reducer. A reduce-side job has one map and multiple reducers. Depending on the clusters status in runtime, a mix-type job may be executed on either side.


Nested Class Summary
static class DistSum.Machine
          Abstract machine for job execution.
static class DistSum.MapSide
          A machine which does computation on the map side.
static class DistSum.MixMachine
          A machine which chooses Machine in runtime according to the cluster status
static class DistSum.ReduceSide
          A machine which does computation on the reduce side.
 
Constructor Summary
DistSum()
           
 
Method Summary
static void main(String[] args)
          main
 int run(String[] args)
          
static Map.Entry<String,TaskResult> string2TaskResult(String s)
          Convert a String to a (String, TaskResult) pair
static String taskResult2string(String name, TaskResult result)
          Convert a TaskResult to a String
 
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

DistSum

public DistSum()
Method Detail

taskResult2string

public static String taskResult2string(String name,
                                       TaskResult result)
Convert a TaskResult to a String


string2TaskResult

public static Map.Entry<String,TaskResult> string2TaskResult(String s)
Convert a String to a (String, TaskResult) pair


run

public int run(String[] args)
        throws Exception

Specified by:
run in interface org.apache.hadoop.util.Tool
Throws:
Exception

main

public static void main(String[] args)
                 throws Exception
main

Throws:
Exception


Copyright © 2009 The Apache Software Foundation