Browse Source

Fix job submission when running against an insecure cluster.

Aaron T. Myers 15 years ago
parent
commit
46e4f9396f

+ 6 - 2
apps/jobsub/src/jobsub/java/src/org/apache/hadoop/security/JobClientTrace.aj

@@ -49,8 +49,12 @@ public aspect JobClientTrace {
    */
   void around(Configuration conf, Credentials credentials):
     call(void JobClient.readTokensFromFiles(Configuration, Credentials)) && args(conf, credentials) {
-    conf.set("mapreduce.job.credentials.binary", System.getenv("HADOOP_TOKEN_FILE_LOCATION"));
-    conf.setBoolean("mapreduce.job.complete.cancel.delegation.tokens", false);
+
+    String hadoopTokenFileLocation = System.getenv("HADOOP_TOKEN_FILE_LOCATION");
+    if (hadoopTokenFileLocation != null) {
+      conf.set("mapreduce.job.credentials.binary", System.getenv("HADOOP_TOKEN_FILE_LOCATION"));
+      conf.setBoolean("mapreduce.job.complete.cancel.delegation.tokens", false);
+    }
     proceed(conf, credentials);
   }
 }