Skip to content

Commit

Permalink
Adding compatibility for hadoopJava jobtype
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahil Takiar committed Mar 23, 2015
1 parent db20876 commit 234f7af
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,17 @@ protected void runJob(String jobName, Properties jobProps, JobState jobState, Li
// Do not cancel delegation tokens after job has completed (HADOOP-7002)
this.conf.setBoolean("mapreduce.job.complete.cancel.delegation.tokens", false);

// Necessary for compatibility with Azkaban's hadoopJava job type
// http://azkaban.github.io/azkaban/docs/2.5/#hadoopjava-type
if (System.getenv("HADOOP_TOKEN_FILE_LOCATION") != null) {
conf.set("mapreduce.job.credentials.binary", System.getenv("HADOOP_TOKEN_FILE_LOCATION"));
}

// Preparing a Hadoop MR job
this.job = Job.getInstance(this.conf, JOB_NAME_PREFIX + jobName);
this.job.setJarByClass(MRJobLauncher.class);
this.job.setMapperClass(TaskRunner.class);

// The job is mapper-only
this.job.setNumReduceTasks(0);

Expand Down

0 comments on commit 234f7af

Please sign in to comment.