Skip to content

Commit

Permalink
Merge pull request apache#59 from sahilTakiar/hadoopJava
Browse files Browse the repository at this point in the history
Adding compatibility for hadoopJava jobtype
  • Loading branch information
sahilTakiar committed Mar 23, 2015
2 parents db20876 + 234f7af commit 5c3244a
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 5c3244a

Please sign in to comment.