this is how my jobrunner looks. How can I set low priority while triggering this job itself ?
public int run(String[] args) throws Exception {
this.initJob();
Path outputPath = new Path(args[2]);
FileInputFormat.setInputPaths(job, args[0]);
FileOutputFormat.setOutputPath(job, outputPath);
job.getConfiguration().set("FREQUENCY", args[3]);
job.getConfiguration().set("TIMEZONE", args[4]);
boolean rc = job.waitForCompletion(true);
if (rc) {
return 0;
}
return 1;
}
public void initJob() throws IOException {
job = new Job(getConf(), "Stats Data Cruncher");
job.setMapOutputKeyClass(Text.class);
job.setMapOutputValueClass(Text.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(NullWritable.class);
Job.setInputFormatClass(LzoTextInputFormat.class);
job.setJarByClass(JobRunner.class);
job.setMapperClass(StatsMapper.class);
job.setCombinerClass(StatsCombiner.class);
job.setReducerClass(StatsReducer.class);
}
is this line valid to set LOW priority ?
job.getConfiguration().set("PRIORITY", "LOW");
“mapred.job.priority” is the property you are looking for.
You can set this in your configuration like this: