diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 7f16f6d4b97..68e3cf3722d 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -384,6 +384,9 @@ Release 0.23.1 - Unreleased MAPREDUCE-3616. Thread pool for launching containers in MR AM not expanding as expected. (vinodkv via sseth) + MAPREDUCE-3639. Fixed TokenCache to work with absent FileSystem canonical + service-names. (Siddharth Seth via vinodkv) + Release 0.23.0 - 2011-11-01 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/security/TokenCache.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/security/TokenCache.java index c3a084d2392..9b60c33f9ae 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/security/TokenCache.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/security/TokenCache.java @@ -172,10 +172,14 @@ public class TokenCache { @InterfaceAudience.Private public static Token getDelegationToken( Credentials credentials, String namenode) { + //No fs specific tokens issues by this fs. It may however issue tokens + // for other filesystems - which would be keyed by that filesystems name. + if (namenode == null) + return null; return (Token) credentials.getToken(new Text( namenode)); } - + /** * load job token from a file * @param conf diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/security/TestTokenCache.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/security/TestTokenCache.java index 5d2101b2292..8c084fe0ba6 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/security/TestTokenCache.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/security/TestTokenCache.java @@ -130,7 +130,7 @@ public class TestTokenCache { private FileSystem setupMultiFs(final FileSystem singleFs, final String renewer, final Credentials credentials) throws Exception { FileSystem mockFs = mock(FileSystem.class); - when(mockFs.getCanonicalServiceName()).thenReturn("multifs"); + when(mockFs.getCanonicalServiceName()).thenReturn(null); when(mockFs.getUri()).thenReturn(new URI("multifs:///")); when(mockFs.getDelegationTokens(any(String.class))).thenThrow(