Browse Source

MAPREDUCE-5826. Fixed HistoryServerFileSystemStore to use right permissions on Windows for temporary files and thus also fix the test-issue with
TestHistoryServerFileSystemStateStoreService. Contributed by Varun Vasudev.
svn merge --ignore-ancestry -c 1586567 ../../trunk/


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.4@1586569 13f79535-47bb-0310-9956-ffa450edef68

Vinod Kumar Vavilapalli 11 years ago
parent
commit
98ee068831

+ 4 - 0
hadoop-mapreduce-project/CHANGES.txt

@@ -20,6 +20,10 @@ Release 2.4.1 - UNRELEASED
     MAPREDUCE-5815. Fixed test-failure of TestMRAppMaster by making MRAppMaster
     gracefully handle empty-queue names. (Akira Ajisaka via vinodkv)
 
+    MAPREDUCE-5826. Fixed HistoryServerFileSystemStore to use right permissions
+    on Windows for temporary files and thus also fix the test-issue with
+    TestHistoryServerFileSystemStateStoreService. (Varun Vasudev via vinodkv)
+
 Release 2.4.0 - 2014-04-07 
 
   INCOMPATIBLE CHANGES

+ 3 - 2
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryServerFileSystemStateStoreService.java

@@ -41,6 +41,7 @@ import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.mapreduce.v2.api.MRDelegationTokenIdentifier;
 import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig;
 import org.apache.hadoop.security.token.delegation.DelegationKey;
+import org.apache.hadoop.util.Shell;
 
 @Private
 @Unstable
@@ -65,8 +66,8 @@ public class HistoryServerFileSystemStateStoreService
   private static final String TMP_FILE_PREFIX = "tmp-";
   private static final FsPermission DIR_PERMISSIONS =
       new FsPermission((short)0700);
-  private static final FsPermission FILE_PERMISSIONS =
-      new FsPermission((short)0400);
+  private static final FsPermission FILE_PERMISSIONS = Shell.WINDOWS
+      ? new FsPermission((short) 0700) : new FsPermission((short) 0400);
   private static final int NUM_TOKEN_BUCKETS = 1000;
 
   private FileSystem fs;