Created
October 2, 2012 14:11
-
-
Save geofferyzh/3819439 to your computer and use it in GitHub Desktop.
GenericOptionsParser's -files flag to pass metadata to task nodes
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
// Pass the file to the task nodes using genericoptionsparser's -files flag | |
// $ hadoop jar MyJob.jar -conf /path/to/cluster-conf.xml -files /path/to/local-file.csv data/input data/output | |
public static class TheMapper extends Mapper<LongWritable, Text, Text, Text> { | |
@Override | |
public void setup(Context context) throws IOException, InterruptedException { | |
CsvReader csv = new CsvReader(new File("local-file.csv")); | |
// work with csv file.. | |
} | |
// .. | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment