Created
July 23, 2013 08:40
-
-
Save zoltanctoth/6060858 to your computer and use it in GitHub Desktop.
How to overwrite output files in a Java Mapreduce application
This file contains 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
package com.prezi.hadoop; | |
import org.apache.hadoop.fs.FileAlreadyExistsException; | |
import org.apache.hadoop.fs.FileSystem; | |
import org.apache.hadoop.mapreduce.JobContext; | |
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat; | |
import java.io.IOException; | |
/* | |
Original idea from: http://ssklogs.blogspot.hu/2012/08/hadoop-outputformat-overwrite-output.html | |
*/ | |
public class OverwriteOutputDirTextOutputFormat extends TextOutputFormat { | |
@Override | |
public void checkOutputSpecs(JobContext job) | |
throws FileAlreadyExistsException, | |
IOException { | |
// bypass the output directory check. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment