浏览代码

MAPREDUCE-4066. Use default value when fetching MR_AM_STAGING_DIR. Contributed by xieguiming.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1305343 13f79535-47bb-0310-9956-ffa450edef68
Harsh J 13 年之前
父节点
当前提交
d5836856a2

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

@@ -173,6 +173,9 @@ Release 0.23.3 - UNRELEASED
     MAPREDUCE-3992. Reduce fetcher doesn't verify HTTP status code of response
     (todd)
 
+    MAPREDUCE-4066. Use default value when fetching MR_AM_STAGING_DIR
+    (xieguiming via harsh)
+
 Release 0.23.2 - UNRELEASED
 
   INCOMPATIBLE CHANGES

+ 4 - 2
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobHistoryUtils.java

@@ -193,7 +193,8 @@ public class JobHistoryUtils {
     String doneDirPrefix = conf
         .get(JHAdminConfig.MR_HISTORY_INTERMEDIATE_DONE_DIR);
     if (doneDirPrefix == null) {
-      doneDirPrefix = conf.get(MRJobConfig.MR_AM_STAGING_DIR)
+      doneDirPrefix = conf.get(MRJobConfig.MR_AM_STAGING_DIR,
+          MRJobConfig.DEFAULT_MR_AM_STAGING_DIR)
           + "/history/done_intermediate";
     }
     return doneDirPrefix;
@@ -208,7 +209,8 @@ public class JobHistoryUtils {
       Configuration conf) {
     String doneDirPrefix = conf.get(JHAdminConfig.MR_HISTORY_DONE_DIR);
     if (doneDirPrefix == null) {
-      doneDirPrefix = conf.get(MRJobConfig.MR_AM_STAGING_DIR)
+      doneDirPrefix = conf.get(MRJobConfig.MR_AM_STAGING_DIR,
+          MRJobConfig.DEFAULT_MR_AM_STAGING_DIR)
           + "/history/done";
     }
     return doneDirPrefix;

+ 3 - 3
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/MRApps.java

@@ -213,9 +213,9 @@ public class MRApps extends Apps {
   
   private static final String STAGING_CONSTANT = ".staging";
   public static Path getStagingAreaDir(Configuration conf, String user) {
-    return new Path(
-        conf.get(MRJobConfig.MR_AM_STAGING_DIR) + 
-        Path.SEPARATOR + user + Path.SEPARATOR + STAGING_CONSTANT);
+    return new Path(conf.get(MRJobConfig.MR_AM_STAGING_DIR,
+        MRJobConfig.DEFAULT_MR_AM_STAGING_DIR)
+        + Path.SEPARATOR + user + Path.SEPARATOR + STAGING_CONSTANT);
   }
 
   public static String getJobFile(Configuration conf, String user, 

+ 2 - 0
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java

@@ -332,6 +332,8 @@ public interface MRJobConfig {
   /** The staging directory for map reduce.*/
   public static final String MR_AM_STAGING_DIR = 
     MR_AM_PREFIX+"staging-dir";
+  public static final String DEFAULT_MR_AM_STAGING_DIR = 
+    "/tmp/hadoop-yarn/staging";
 
   /** The amount of memory the MR app master needs.*/
   public static final String MR_AM_VMEM_MB =