Bläddra i källkod

commit 1f1feb69b24b4093b1a36ac02fbb3ed30e1257cc
Author: Lee Tucker <ltucker@yahoo-inc.com>
Date: Thu Jul 30 17:40:43 2009 -0700

Applying patch 2852881.mr683.patch


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

Owen O'Malley 14 år sedan
förälder
incheckning
9333e1d6ab

+ 5 - 3
src/mapred/org/apache/hadoop/mapred/JobHistory.java

@@ -92,12 +92,11 @@ public class JobHistory {
   public static final int JOB_NAME_TRIM_LENGTH = 50;
   private static String JOBTRACKER_UNIQUE_STRING = null;
   private static String LOG_DIR = null;
-  private static boolean disableHistory = false; 
+  private static boolean disableHistory = true; 
   private static final String SECONDARY_FILE_SUFFIX = ".recover";
   private static long jobHistoryBlockSize = 0;
   private static String jobtrackerHostname;
-  private static JobHistoryFilesManager fileManager = 
-    new JobHistoryFilesManager();
+  private static JobHistoryFilesManager fileManager = null;
   final static FsPermission HISTORY_DIR_PERMISSION =
     FsPermission.createImmutable((short) 0750); // rwxr-x---
   final static FsPermission HISTORY_FILE_PERMISSION =
@@ -235,6 +234,9 @@ public class JobHistory {
 
       // create the done folder with appropriate permission
       fs.mkdirs(DONE, HISTORY_DIR_PERMISSION);
+
+      // initialize the file manager
+      fileManager = new JobHistoryFilesManager();
     } catch(IOException e) {
         LOG.error("Failed to initialize JobHistory log file", e); 
         disableHistory = true;

+ 3 - 3
src/test/org/apache/hadoop/mapred/TestJobHistoryParsing.java

@@ -56,10 +56,10 @@ public class TestJobHistoryParsing  extends TestCase {
     // open a test history file
     Path historyDir = new Path(System.getProperty("test.build.data", "."), 
                                 "history");
+    JobConf conf = new JobConf();
+    conf.set("hadoop.job.history.location", historyDir.toString());
     FileSystem fs = FileSystem.getLocal(new JobConf());
-    if (!fs.mkdirs(historyDir)) {
-      fail("Failed to create history directory");
-    }
+    JobHistory.init(conf, "localhost", 1234);
     Path historyLog = new Path(historyDir, "testlog");
     PrintWriter out = new PrintWriter(fs.create(historyLog));
     historyWriter.add(out);