org.apache.hadoop.examples
Class QuasiMonteCarlo.QmcReducer

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.BooleanWritable,org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.WritableComparable<?>,org.apache.hadoop.io.Writable>
      extended by org.apache.hadoop.examples.QuasiMonteCarlo.QmcReducer
Enclosing class:
QuasiMonteCarlo

public static class QuasiMonteCarlo.QmcReducer
extends org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.BooleanWritable,org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.WritableComparable<?>,org.apache.hadoop.io.Writable>

Reducer class for Pi estimation. Accumulate points inside/outside results from the mappers.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
org.apache.hadoop.mapreduce.Reducer.Context
 
Constructor Summary
QuasiMonteCarlo.QmcReducer()
           
 
Method Summary
 void cleanup(org.apache.hadoop.mapreduce.Reducer.Context context)
          Reduce task done, write output to a file.
 void reduce(org.apache.hadoop.io.BooleanWritable isInside, Iterable<org.apache.hadoop.io.LongWritable> values, org.apache.hadoop.mapreduce.Reducer.Context context)
          Accumulate number of points inside/outside results from the mappers.
 
Methods inherited from class org.apache.hadoop.mapreduce.Reducer
run, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuasiMonteCarlo.QmcReducer

public QuasiMonteCarlo.QmcReducer()
Method Detail

reduce

public void reduce(org.apache.hadoop.io.BooleanWritable isInside,
                   Iterable<org.apache.hadoop.io.LongWritable> values,
                   org.apache.hadoop.mapreduce.Reducer.Context context)
            throws IOException,
                   InterruptedException
Accumulate number of points inside/outside results from the mappers.

Overrides:
reduce in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.BooleanWritable,org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.WritableComparable<?>,org.apache.hadoop.io.Writable>
Parameters:
isInside - Is the points inside?
values - An iterator to a list of point counts
context - dummy, not used here.
Throws:
IOException
InterruptedException

cleanup

public void cleanup(org.apache.hadoop.mapreduce.Reducer.Context context)
             throws IOException
Reduce task done, write output to a file.

Overrides:
cleanup in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.BooleanWritable,org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.WritableComparable<?>,org.apache.hadoop.io.Writable>
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.