1
0
فهرست منبع

HADOOP-2727. Fixes a problem to do with file: URI in the JobHistory init. Contributed by Amareshwari Sri Ramadasu.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@631912 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 17 سال پیش
والد
کامیت
3df0ec788b
3فایلهای تغییر یافته به همراه10 افزوده شده و 4 حذف شده
  1. 3 0
      CHANGES.txt
  2. 3 3
      conf/hadoop-default.xml
  3. 4 1
      src/java/org/apache/hadoop/mapred/JobHistory.java

+ 3 - 0
CHANGES.txt

@@ -74,6 +74,9 @@ Trunk (unreleased changes)
     HADOOP-2727. Fix links in Web UI of the hadoop daemons and some docs
     (Amareshwari Sri Ramadasu via ddas)
 
+    HADOOP-2727. Fixes a problem to do with file: URI in the JobHistory init.
+    (Amareshwari Sri Ramadasu via ddas)
+
 Release 0.16.1 - Unreleased
 
   IMPROVEMENTS

+ 3 - 3
conf/hadoop-default.xml

@@ -37,10 +37,10 @@
 
 <property>
   <name>hadoop.job.history.location</name>
-  <value>file://${hadoop.log.dir}/history</value>
+  <value></value>
   <description> If job tracker is static the history files are stored 
-  in this single well known place. By default, it is in the local 
-  file system at ${hadoop.log.dir}/history.
+  in this single well known place. If No value is set here, by default,
+  it is in the local file system at ${hadoop.log.dir}/history.
   </description>
 </property>
 

+ 4 - 1
src/java/org/apache/hadoop/mapred/JobHistory.java

@@ -116,7 +116,9 @@ public class JobHistory {
   public static void init(JobConf conf, String hostname){
     if (!disableHistory){
       try{
-        LOG_DIR = conf.get("hadoop.job.history.location");
+        LOG_DIR = conf.get("hadoop.job.history.location" ,
+          "file:///" + new File(System.getProperty(
+          "hadoop.log.dir")).getAbsolutePath() + File.separator + "history");
         JOBTRACKER_UNIQUE_STRING = hostname + "_" + 
                                    JOBTRACKER_START_TIME + "_";
         Path logDir = new Path(LOG_DIR);
@@ -126,6 +128,7 @@ public class JobHistory {
             throw new IOException("Mkdirs failed to create " + logDir.toString());
           }
         }
+        conf.set("hadoop.job.history.location", LOG_DIR);
       }catch(IOException e){
         LOG.error("Failed to initialize JobHistory log file", e); 
         disableHistory = true;