hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r643329 - in /hadoop/core/trunk: CHANGES.txt src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java src/java/org/apache/hadoop/mapred/Counters.java src/webapps/job/jobdetails.jsp src/webapps/job/taskstats.jsp
Date Tue, 01 Apr 2008 09:13:06 GMT
Author: tomwhite
Date: Tue Apr  1 02:12:42 2008
New Revision: 643329

URL: http://svn.apache.org/viewvc?rev=643329&view=rev
Log:
HADOOP-2818.  Remove deprecated methods in Counters.  Contributed by Amareshwari Sriramadasu.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java
    hadoop/core/trunk/src/java/org/apache/hadoop/mapred/Counters.java
    hadoop/core/trunk/src/webapps/job/jobdetails.jsp
    hadoop/core/trunk/src/webapps/job/taskstats.jsp

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=643329&r1=643328&r2=643329&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue Apr  1 02:12:42 2008
@@ -65,6 +65,9 @@
     HADOOP-2563. Remove deprecated FileSystem::listPaths.
     (lohit vijayarenu via cdouglas)
 
+    HADOOP-2818.  Remove deprecated methods in Counters.
+    (Amareshwari Sriramadasu via tomwhite)
+
   NEW FEATURES
 
     HADOOP-1398.  Add HBase in-memory block cache.  (tomwhite)

Modified: hadoop/core/trunk/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java?rev=643329&r1=643328&r2=643329&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java
(original)
+++ hadoop/core/trunk/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopJob.java
Tue Apr  1 02:12:42 2008
@@ -301,8 +301,9 @@
       Counters.Group group = counters.getGroup(groupName);
       System.out.printf("\t%s[%s]\n", groupName, group.getDisplayName());
 
-      for (String name : group.getCounterNames()) {
-        System.out.printf("\t\t%s: %s\n", name, group.getCounter(name));
+      for (Counters.Counter counter : group) {
+        System.out.printf("\t\t%s: %s\n", counter.getDisplayName(),
+                                          counter.getCounter());
       }
     }
     System.out.printf("\n");

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/mapred/Counters.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/mapred/Counters.java?rev=643329&r1=643328&r2=643329&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/mapred/Counters.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/mapred/Counters.java Tue Apr  1 02:12:42
2008
@@ -162,31 +162,8 @@
     }
     
     /**
-     * Returns localized name of the specified counter.
-     * @deprecated get the counter directly
-     */
-    public String getDisplayName(String counter) {
-      return counter;
-    }
-    
-    /**
-     * Returns the counters for this group, with their names localized.
-     * @deprecated iterate through the group instead
-     */
-    public synchronized Collection<String> getCounterNames() {
-      List<String> result = new ArrayList<String>();
-      for (Counter counter:subcounters) {
-        if (counter != null) {
-          result.add(counter.displayName);
-        }
-      }
-      return result;
-    }
-    
-    /**
      * Returns the value of the specified counter, or 0 if the counter does
      * not exist.
-     * @deprecated
      */
     public synchronized long getCounter(String counterName) {
       for(Counter counter: subcounters) {

Modified: hadoop/core/trunk/src/webapps/job/jobdetails.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/job/jobdetails.jsp?rev=643329&r1=643328&r2=643329&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/job/jobdetails.jsp (original)
+++ hadoop/core/trunk/src/webapps/job/jobdetails.jsp Tue Apr  1 02:12:42 2008
@@ -226,10 +226,11 @@
       Format decimal = new DecimalFormat();
       
       boolean isFirst = true;
-      for (String counter : totalGroup.getCounterNames()) {
-        String mapValue = decimal.format(mapGroup.getCounter(counter));
-        String reduceValue = decimal.format(reduceGroup.getCounter(counter));
-        String totalValue = decimal.format(totalGroup.getCounter(counter));
+      for (Counters.Counter counter : totalGroup) {
+        String name = counter.getDisplayName();
+        String mapValue = decimal.format(mapGroup.getCounter(name));
+        String reduceValue = decimal.format(reduceGroup.getCounter(name));
+        String totalValue = decimal.format(counter.getCounter());
         %>
         <tr>
           <%
@@ -240,7 +241,7 @@
             <%
           }
           %>
-          <td><%=totalGroup.getDisplayName(counter)%></td>
+          <td><%=name%></td>
           <td align="right"><%=mapValue%></td>
           <td align="right"><%=reduceValue%></td>
           <td align="right"><%=totalValue%></td>

Modified: hadoop/core/trunk/src/webapps/job/taskstats.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/job/taskstats.jsp?rev=643329&r1=643328&r2=643329&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/job/taskstats.jsp (original)
+++ hadoop/core/trunk/src/webapps/job/taskstats.jsp Tue Apr  1 02:12:42 2008
@@ -56,9 +56,9 @@
           <td colspan="3"><br/><b><%=displayGroupName%></b></td>
         </tr>
 <%
-        for (String counter : group.getCounterNames()) {
-          String displayCounterName = group.getDisplayName(counter);
-          long value = group.getCounter(counter);
+        for (Counters.Counter counter : group) {
+          String displayCounterName = counter.getDisplayName();
+          long value = counter.getCounter();
 %>
           <tr>
             <td width="50"></td>



Mime
View raw message