Created
November 4, 2014 23:11
-
-
Save shrijeet/0469b4a44282c90d5632 to your computer and use it in GitHub Desktop.
Pi's cleanup method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void cleanup(Context context) throws IOException { | |
//write output to a file | |
Configuration conf = context.getConfiguration(); | |
Path outDir = new Path(conf.get(FileOutputFormat.OUTDIR)); | |
Path outFile = new Path(outDir, "reduce-out"); | |
FileSystem fileSys = FileSystem.get(conf); | |
SequenceFile.Writer writer = SequenceFile.createWriter(fileSys, conf, | |
outFile, LongWritable.class, LongWritable.class, | |
CompressionType.NONE); | |
writer.append(new LongWritable(numInside), new LongWritable(numOutside)); | |
writer.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment