hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r747297 [1/3] - in /hadoop/core/trunk: ./ src/mapred/org/apache/hadoop/mapred/ src/test/org/apache/hadoop/mapred/
Date Tue, 24 Feb 2009 08:01:03 GMT
Author: ddas
Date: Tue Feb 24 08:01:02 2009
New Revision: 747297

URL: http://svn.apache.org/viewvc?rev=747297&view=rev
Log:
HADOOP-4191. Adds a testcase for JobHistory. Contributed by Ravi Gummadi.

Added:
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestJobHistory.java
Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java
    hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/NotificationTestCase.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestJobHistoryVersion.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestJobInProgressListener.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestJobKillAndFail.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestJobTrackerRestart.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestJobTrackerRestartWithLostTracker.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestLostTracker.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/UtilsForTests.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=747297&r1=747296&r2=747297&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue Feb 24 08:01:02 2009
@@ -129,6 +129,8 @@
     HADOOP-5240. Skip re-building javadoc when it is already
     up-to-date. (Aaron Kimball via cutting)
 
+    HADOOP-4191. Adds a testcase for JobHistory. (Ravi Gummadi via ddas)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java?rev=747297&r1=747296&r2=747297&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java Tue Feb 24 08:01:02
2009
@@ -77,14 +77,16 @@
   static final long VERSION = 1L;
   public static final Log LOG = LogFactory.getLog(JobHistory.class);
   private static final String DELIMITER = " ";
-  private static final char LINE_DELIMITER_CHAR = '.';
-  private static final char[] charsToEscape = new char[] {'"', '=', 
+  static final char LINE_DELIMITER_CHAR = '.';
+  static final char[] charsToEscape = new char[] {'"', '=', 
                                                 LINE_DELIMITER_CHAR};
-  private static final String KEY = "(\\w+)";
+  static final String DIGITS = "[0-9]+";
+
+  static final String KEY = "(\\w+)";
   // value is any character other than quote, but escaped quotes can be there
-  private static final String VALUE = "[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*"; 
+  static final String VALUE = "[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*"; 
   
-  private static final Pattern pattern = Pattern.compile(KEY + "=" + "\"" + VALUE + "\"");
+  static final Pattern pattern = Pattern.compile(KEY + "=" + "\"" + VALUE + "\"");
   
   public static final int JOB_NAME_TRIM_LENGTH = 50;
   private static String JOBTRACKER_UNIQUE_STRING = null;
@@ -634,7 +636,7 @@
 
       // Make the pattern matching the job's history file
       final Pattern historyFilePattern = 
-        Pattern.compile(jobtrackerHostname + "_" + "[0-9]+" + "_" 
+        Pattern.compile(jobtrackerHostname + "_" + DIGITS + "_" 
                         + id.toString() + "_" + user + "_" + jobName + "+");
       // a path filter that matches 4 parts of the filenames namely
       //  - jt-hostname

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java?rev=747297&r1=747296&r2=747297&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java Tue Feb 24 08:01:02
2009
@@ -299,7 +299,7 @@
     return !activeTasks.isEmpty();
   }
     
-  private TaskAttemptID getSuccessfulTaskid() {
+  TaskAttemptID getSuccessfulTaskid() {
     return successfulTaskId;
   }
   

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/NotificationTestCase.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/NotificationTestCase.java?rev=747297&r1=747296&r2=747297&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/NotificationTestCase.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/NotificationTestCase.java Tue Feb
24 08:01:02 2009
@@ -165,8 +165,20 @@
     }
     assertEquals(2, NotificationServlet.counter);
     
+    Path inDir = new Path("notificationjob/input");
+    Path outDir = new Path("notificationjob/output");
+
+    // Hack for local FS that does not have the concept of a 'mounting point'
+    if (isLocalFS()) {
+      String localPathRoot = System.getProperty("test.build.data","/tmp")
+        .toString().replace(' ', '+');;
+      inDir = new Path(localPathRoot, inDir);
+      outDir = new Path(localPathRoot, outDir);
+    }
+
     // run a job with KILLED status
-    System.out.println(TestJobKillAndFail.runJobKill(this.createJobConf()));
+    System.out.println(UtilsForTests.runJobKill(this.createJobConf(), inDir,
+                                                outDir).getID());
     synchronized(Thread.currentThread()) {
       stdPrintln("Sleeping for 2 seconds to give time for retry");
       Thread.currentThread().sleep(2000);
@@ -174,7 +186,8 @@
     assertEquals(4, NotificationServlet.counter);
     
     // run a job with FAILED status
-    System.out.println(TestJobKillAndFail.runJobFail(this.createJobConf()));
+    System.out.println(UtilsForTests.runJobFail(this.createJobConf(), inDir,
+                                                outDir).getID());
     synchronized(Thread.currentThread()) {
       stdPrintln("Sleeping for 2 seconds to give time for retry");
       Thread.currentThread().sleep(2000);



Mime
View raw message