From e42b889bdbccb691ebb942d56808c6624056884a Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Tue, 9 Sep 2014 22:19:42 -0700 Subject: [PATCH] HADOOP-9989. Bug introduced in HADOOP-9374, which parses the -tokenCacheFile as binary file but set it to the configuration as JSON file. (zxu via tucu) --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../main/java/org/apache/hadoop/util/GenericOptionsParser.java | 2 +- .../java/org/apache/hadoop/util/TestGenericOptionsParser.java | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index b94198caedd..dc3f97ddbe5 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -444,6 +444,9 @@ Release 2.6.0 - UNRELEASED HADOOP-11077. NPE if hosts not specified in ProxyUsers. (gchanan via tucu) + HADOOP-9989. Bug introduced in HADOOP-9374, which parses the -tokenCacheFile + as binary file but set it to the configuration as JSON file. (zxu via tucu) + Release 2.5.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java index 18acbf109a2..2a37dac460d 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java @@ -332,7 +332,7 @@ public class GenericOptionsParser { } UserGroupInformation.getCurrentUser().addCredentials( Credentials.readTokenStorageFile(p, conf)); - conf.set("mapreduce.job.credentials.json", p.toString(), + conf.set("mapreduce.job.credentials.binary", p.toString(), "from -tokenCacheFile command line option"); } diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGenericOptionsParser.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGenericOptionsParser.java index 779318acc8e..2bc19154f40 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGenericOptionsParser.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGenericOptionsParser.java @@ -249,7 +249,7 @@ public class TestGenericOptionsParser extends TestCase { creds.writeTokenStorageFile(tmpPath, conf); new GenericOptionsParser(conf, args); - String fileName = conf.get("mapreduce.job.credentials.json"); + String fileName = conf.get("mapreduce.job.credentials.binary"); assertNotNull("files is null", fileName); assertEquals("files option does not match", tmpPath.toString(), fileName);