List of usage examples for org.apache.hadoop.mapreduce Job createSymlink
@Deprecated public void createSymlink()
From source file:dz.lab.mapred.exclude.StartsWithCountJob_DistCacheAPI.java
@Override public int run(String[] args) throws Exception { Configuration conf = getConf(); // the following property will enable mapreduce to use its packaged local job runner //conf.set("mapreduce.framework.name", "local"); Job job = Job.getInstance(conf, "StartsWithCountJob"); job.setJarByClass(getClass());//w w w .j a va2 s .c o m // configure output and input source TextInputFormat.addInputPath(job, new Path(args[0])); job.setInputFormatClass(TextInputFormat.class); // configure mapper and reducer job.setMapperClass(StartsWithCountMapper.class); job.setCombinerClass(StartsWithCountReducer.class); job.setReducerClass(StartsWithCountReducer.class); // configure output TextOutputFormat.setOutputPath(job, new Path(args[1])); job.setOutputFormatClass(TextOutputFormat.class); job.setOutputKeyClass(Text.class); job.setOutputValueClass(IntWritable.class); Path toCache = new Path("/training/data/startWithExcludeFile.txt"); // add file to cache job.addCacheFile(toCache.toUri()); // create symbolic links for all files in DistributedCache; without the links you would have to use fully qualified path job.createSymlink(); return job.waitForCompletion(true) ? 0 : 1; }