From 234f7af5f22a92130b36afbe1cedb9924b0cc613 Mon Sep 17 00:00:00 2001 From: Sahil Takiar Date: Mon, 23 Mar 2015 14:39:26 -0700 Subject: [PATCH] Adding compatibility for hadoopJava jobtype --- .../main/java/gobblin/runtime/mapreduce/MRJobLauncher.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gobblin-runtime/src/main/java/gobblin/runtime/mapreduce/MRJobLauncher.java b/gobblin-runtime/src/main/java/gobblin/runtime/mapreduce/MRJobLauncher.java index dbc9a53b43e..125614166f8 100644 --- a/gobblin-runtime/src/main/java/gobblin/runtime/mapreduce/MRJobLauncher.java +++ b/gobblin-runtime/src/main/java/gobblin/runtime/mapreduce/MRJobLauncher.java @@ -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);