org.apache.hadoop.examples
Class QuasiMonteCarlo.QmcMapper
java.lang.Object
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>
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.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QuasiMonteCarlo.QmcMapper
public QuasiMonteCarlo.QmcMapper()
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 mapcontext
- output {ture->numInside, false->numOutside}
- Throws:
IOException
InterruptedException
Copyright © 2009 The Apache Software Foundation