hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077548 - in /hadoop/common/branches/branch-0.20-security-patches/src: mapred/org/apache/hadoop/mapred/JobHistory.java test/org/apache/hadoop/mapred/TestJobHistory.java webapps/job/jobhistory.jsp
Date Fri, 04 Mar 2011 04:27:55 GMT
Author: omalley
Date: Fri Mar  4 04:27:55 2011
New Revision: 1077548

URL: http://svn.apache.org/viewvc?rev=1077548&view=rev
Log:
commit 29cbffa625f517765dea4ccfa949322bd0e1283a
Author: Arun C Murthy <acmurthy@apache.org>
Date:   Thu Jul 15 19:40:51 2010 -0700

    MAPREDUCE-323. Added versioning to JobHistory directories to be future-proof.

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobHistory.java
    hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/mapred/TestJobHistory.java
    hadoop/common/branches/branch-0.20-security-patches/src/webapps/job/jobhistory.jsp

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobHistory.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobHistory.java?rev=1077548&r1=1077547&r2=1077548&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobHistory.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobHistory.java
Fri Mar  4 04:27:55 2011
@@ -92,6 +92,12 @@ import org.apache.hadoop.util.StringUtil
 public class JobHistory {
   
   static final long VERSION = 1L;
+
+  static final int DONE_DIRECTORY_FORMAT_VERSION = 1;
+
+  static final String DONE_DIRECTORY_FORMAT_DIRNAME
+    = "version-" + DONE_DIRECTORY_FORMAT_VERSION;
+
   public static final Log LOG = LogFactory.getLog(JobHistory.class);
   private static final char DELIMITER = ' ';
   static final char LINE_DELIMITER_CHAR = '.';
@@ -411,7 +417,9 @@ public class JobHistory {
   }
 
   private static String historyLogSubdirectory(JobID id, long millisecondTime) {
-    String result = jobtrackerDirectoryComponent(id);
+    String result
+      = (DONE_DIRECTORY_FORMAT_DIRNAME
+         + "/" + jobtrackerDirectoryComponent(id));
 
     String serialNumberDirectory = serialNumberDirectoryComponent(id);
 
@@ -429,7 +437,9 @@ public class JobHistory {
 
   private static String doneSubdirsBeforeSerialTail() {
     // job tracker ID
-    String result = "/*";   // job tracker instance ID
+    String result
+      = ("/" + DONE_DIRECTORY_FORMAT_DIRNAME
+         + "/*");   // job tracker instance ID
 
     // date
     result = result + "/*/*/*";  // YYYY/MM/DD ;

Modified: hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/mapred/TestJobHistory.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/mapred/TestJobHistory.java?rev=1077548&r1=1077547&r2=1077548&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/mapred/TestJobHistory.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/mapred/TestJobHistory.java
Fri Mar  4 04:27:55 2011
@@ -473,6 +473,13 @@ public class TestJobHistory extends Test
     // Check if the history file exists
     assertTrue("History file does not exist", fileSys.exists(logFile));
 
+    // Check that the log file name includes a directory level for the version number
+    assertTrue("History filename does not include a directory level "
+                 + "for the version number.",
+               logFile.toString()
+                 .contains("/"
+                           + JobHistory.DONE_DIRECTORY_FORMAT_DIRNAME
+                           + "/"));
 
     // check if the history file is parsable
     String[] jobDetails = JobHistory.JobInfo.decodeJobHistoryFileName(

Modified: hadoop/common/branches/branch-0.20-security-patches/src/webapps/job/jobhistory.jsp
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/webapps/job/jobhistory.jsp?rev=1077548&r1=1077547&r2=1077548&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/webapps/job/jobhistory.jsp (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/webapps/job/jobhistory.jsp Fri
Mar  4 04:27:55 2011
@@ -182,6 +182,8 @@ window.location.href = url;
       }
     };
 
+    String versionComponent = JobHistory.DONE_DIRECTORY_FORMAT_DIRNAME;
+
     String trackerComponent = "*";
 
     // build the glob
@@ -214,7 +216,9 @@ window.location.href = url;
     // number directories, but not the individual files.
     Path historyPath = new Path(historyLogDir);
 
-    String leadGlob = (trackerComponent + "/" + dateComponent);
+    String leadGlob = (versionComponent
+            + "/" + trackerComponent
+            + "/" + dateComponent);
 
     // Atomicity is unimportant here.
     // I would have used MutableBoxedBoolean if such had been provided.



Mime
View raw message