hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r541096 - in /lucene/hadoop/trunk: CHANGES.txt build.xml src/java/org/apache/hadoop/mapred/DefaultJobHistoryParser.java src/webapps/job/jobhistory.jsp
Date Wed, 23 May 2007 21:31:19 GMT
Author: cutting
Date: Wed May 23 14:31:18 2007
New Revision: 541096

URL: http://svn.apache.org/viewvc?view=rev&rev=541096
Log:
HADOOP-1408.  Fix a compiler warning by adding a class to replace a generic.  Contributed
by Owen.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/build.xml
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/DefaultJobHistoryParser.java
    lucene/hadoop/trunk/src/webapps/job/jobhistory.jsp

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=541096&r1=541095&r2=541096
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed May 23 14:31:18 2007
@@ -66,6 +66,9 @@
  21. HADOOP-800.  Improvements to HDFS web-based file browser.
      (Enis Soztutar via cutting)
 
+ 22. HADOOP-1408.  Fix a compiler warning by adding a class to replace
+     a generic.  (omalley via cutting)
+
 
 Branch 0.13 (unreleased changes)
 

Modified: lucene/hadoop/trunk/build.xml
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/build.xml?view=diff&rev=541096&r1=541095&r2=541096
==============================================================================
--- lucene/hadoop/trunk/build.xml (original)
+++ lucene/hadoop/trunk/build.xml Wed May 23 14:31:18 2007
@@ -225,7 +225,6 @@
      encoding="${build.encoding}" 
      srcdir="${src.dir};${build.src}"
      includes="org/apache/hadoop/**/*.java"
-     excludes="org/apache/hadoop/**/*_jsp.java"
      destdir="${build.classes}"
      debug="${javac.debug}"
      optimize="${javac.optimize}"
@@ -236,21 +235,6 @@
       <classpath refid="classpath"/>
     </javac>   
   	
-    <!-- Compile JSPs without checking warnings -->
-    <javac 
-     encoding="${build.encoding}" 
-     srcdir="${src.dir};${build.src}"
-     includes="org/apache/hadoop/**/*_jsp.java"
-     destdir="${build.classes}"
-     debug="${javac.debug}"
-     optimize="${javac.optimize}"
-     target="${javac.version}"
-     source="${javac.version}"
-     deprecation="${javac.deprecation}">
-      <compilerarg line="${javac.args}" />
-      <classpath refid="classpath"/>
-    </javac>
-    
     <copy todir="${build.classes}">
       <fileset 
         dir="${src.dir}" 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/DefaultJobHistoryParser.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/DefaultJobHistoryParser.java?view=diff&rev=541096&r1=541095&r2=541096
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/DefaultJobHistoryParser.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/DefaultJobHistoryParser.java Wed
May 23 14:31:18 2007
@@ -3,7 +3,7 @@
 import java.util.*;
 import java.io.*;
 import org.apache.hadoop.mapred.JobHistory.Keys; 
-import org.apache.hadoop.mapred.JobHistory.Values;;
+import org.apache.hadoop.mapred.JobHistory.Values;
 
 /**
  * Default parser for job history files. It creates object model from 
@@ -12,14 +12,27 @@
  */
 public class DefaultJobHistoryParser {
 
+  // This class is required to work around the Java compiler's lack of
+  // run-time information on generic classes. In particular, we need to be able
+  // to cast to this type without generating compiler warnings, which is only
+  // possible if it is a non-generic class.
+
+  /**
+   * Contents of a job history file. Maps: 
+   * <xmp>jobTrackerId -> <jobId, JobHistory.JobInfo>*</xmp>
+   */
+  public static class MasterIndex 
+    extends TreeMap<String, Map<String, JobHistory.JobInfo>> {
+    
+  }
+
   /**
-   * Parses a master index file and returns a Map of 
-   * (jobTrakerId - Map (job Id - JobHistory.JobInfo)). 
+   * Parses a master index file and returns a {@link MasterIndex}.
    * @param historyFile master index history file. 
-   * @return a map of values, as described as described earlier.  
+   * @return a {@link MasterIndex}.  
    * @throws IOException
    */
-  public static Map<String, Map<String, JobHistory.JobInfo>> parseMasterIndex(File
historyFile)
+  public static MasterIndex parseMasterIndex(File historyFile)
     throws IOException {
     MasterIndexParseListener parser = new MasterIndexParseListener();
     JobHistory.parseHistory(historyFile, parser);
@@ -120,7 +133,7 @@
    */
   static class MasterIndexParseListener
     implements JobHistory.Listener {
-    Map<String, Map<String, JobHistory.JobInfo>> jobTrackerToJobs = new TreeMap<String,
Map<String, JobHistory.JobInfo>>();
+    MasterIndex jobTrackerToJobs = new MasterIndex();
 
     Map<String, JobHistory.JobInfo> activeJobs = null;
     String currentTracker; 
@@ -150,7 +163,7 @@
      * Return map of parsed values. 
      * @return
      */ 
-    Map<String, Map<String, JobHistory.JobInfo>> getValues() {
+    MasterIndex getValues() {
       return jobTrackerToJobs;
     }
   }

Modified: lucene/hadoop/trunk/src/webapps/job/jobhistory.jsp
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/webapps/job/jobhistory.jsp?view=diff&rev=541096&r1=541095&r2=541096
==============================================================================
--- lucene/hadoop/trunk/src/webapps/job/jobhistory.jsp (original)
+++ lucene/hadoop/trunk/src/webapps/job/jobhistory.jsp Wed May 23 14:31:18 2007
@@ -5,7 +5,8 @@
   import="org.apache.hadoop.mapred.*"
   import="org.apache.hadoop.util.*"
   import="javax.servlet.jsp.*"
-  import="java.text.SimpleDateFormat"  
+  import="java.text.SimpleDateFormat"
+  import="org.apache.hadoop.mapred.*"
   import="org.apache.hadoop.mapred.JobHistory.*"
 %>
 <jsp:include page="loadhistory.jsp">
@@ -18,8 +19,9 @@
 
 <html><body>
 <%
-		Map<String, Map<String, JobInfo>> jobTrackerToJobs = 
-		  (Map<String, Map<String, JobInfo>>)request.getSession().getAttribute("jobHistory");

+		DefaultJobHistoryParser.MasterIndex jobTrackerToJobs = 
+		  (DefaultJobHistoryParser.MasterIndex)request.getSession().
+		  getAttribute("jobHistory"); 
 		
 		if( null == jobTrackerToJobs ){
 		  out.println("NULL !!!"); 



Mime
View raw message