org.apache.hadoop.examples
Class QuasiMonteCarlo.QmcMapper

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BooleanWritable,org.apache.hadoop.io.LongWritable>
      extended by org.apache.hadoop.examples.QuasiMonteCarlo.QmcMapper
Enclosing class:
QuasiMonteCarlo

public static class QuasiMonteCarlo.QmcMapper
extends Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BooleanWritable,org.apache.hadoop.io.LongWritable>

Mapper class for Pi estimation. Generate points in a unit square and then count points inside/outside of the inscribed circle of the square.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
Mapper.Context
 
Constructor Summary
QuasiMonteCarlo.QmcMapper()
           
 
Method Summary
 void map(org.apache.hadoop.io.LongWritable offset, org.apache.hadoop.io.LongWritable size, Mapper.Context context)
          Map method.
 
Methods inherited from class org.apache.hadoop.mapreduce.Mapper
cleanup, run, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuasiMonteCarlo.QmcMapper

public QuasiMonteCarlo.QmcMapper()
Method Detail

map

public void map(org.apache.hadoop.io.LongWritable offset,
                org.apache.hadoop.io.LongWritable size,
                Mapper.Context context)
         throws IOException,
                InterruptedException
Map method.

Overrides:
map in class Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BooleanWritable,org.apache.hadoop.io.LongWritable>
Parameters:
offset - samples starting from the (offset+1)th sample.
size - the number of samples for this map
context - output {ture->numInside, false->numOutside}
Throws:
IOException
InterruptedException


Copyright © 2009 The Apache Software Foundation