public static class PiEstimator.PiReducer extends MapReduceBase implements Reducer<BooleanWritable,LongWritable,WritableComparable<?>,Writable>
Constructor and Description |
---|
PiReducer() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Reduce task done, write output to a file.
|
void |
configure(JobConf job)
Store job configuration.
|
void |
reduce(BooleanWritable isInside,
Iterator<LongWritable> values,
OutputCollector<WritableComparable<?>,Writable> output,
Reporter reporter)
Accumulate number of points inside/outside results from the mappers.
|
public void configure(JobConf job)
configure
in interface JobConfigurable
configure
in class MapReduceBase
job
- the configurationpublic void reduce(BooleanWritable isInside, Iterator<LongWritable> values, OutputCollector<WritableComparable<?>,Writable> output, Reporter reporter) throws IOException
reduce
in interface Reducer<BooleanWritable,LongWritable,WritableComparable<?>,Writable>
isInside
- Is the points inside?values
- An iterator to a list of point countsoutput
- dummy, not used here.reporter
- IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class MapReduceBase
IOException
Copyright © 2010 The Apache Software Foundation