hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r1129771 - in /hadoop/mapreduce/trunk: ./ src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/ src/java/org/apache/hadoop/mapred/ src/test/mapred/org/apache/hadoop/ma...
Date Tue, 31 May 2011 16:06:25 GMT
Author: tomwhite
Date: Tue May 31 16:06:25 2011
New Revision: 1129771

URL: http://svn.apache.org/viewvc?rev=1129771&view=rev
Log:
MAPREDUCE-2455. Remove deprecated JobTracker.State in favour of JobTrackerStatus.

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/CapacityTestUtils.java
    hadoop/mapreduce/trunk/src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/TestFairScheduler.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/ClusterStatus.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobClient.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/FakeObjectUtilities.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestJobInProgress.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestJobQueueTaskScheduler.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestParallelInitialization.java
    hadoop/mapreduce/trunk/src/webapps/job/jobtracker.jsp
    hadoop/mapreduce/trunk/src/webapps/job/jobtracker.jspx

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Tue May 31 16:06:25 2011
@@ -4,6 +4,9 @@ Trunk (unreleased changes)
 
   INCOMPATIBLE CHANGES
 
+    MAPREDUCE-2455. Remove deprecated JobTracker.State in favour of
+    JobTrackerStatus. (tomwhite)
+
   NEW FEATURES
 
     MAPREDUCE-2408. [Gridmix] Compression emulation in Gridmix. (amarrk)

Modified: hadoop/mapreduce/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/CapacityTestUtils.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/CapacityTestUtils.java?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/CapacityTestUtils.java
(original)
+++ hadoop/mapreduce/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/CapacityTestUtils.java
Tue May 31 16:06:25 2011
@@ -37,6 +37,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.BytesWritable;
+import org.apache.hadoop.mapreduce.Cluster.JobTrackerStatus;
 import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.QueueState;
 import static org.apache.hadoop.mapred.QueueManager.toFullPropertyName;
@@ -670,7 +671,7 @@ public class CapacityTestUtils {
         ttExpiryInterval, maps, reduces,
         numTrackers * maxMapTasksPerTracker,
         numTrackers * maxReduceTasksPerTracker,
-        JobTracker.State.RUNNING);
+        JobTrackerStatus.RUNNING);
     }
 
     public int getNumberOfUniqueHosts() {

Modified: hadoop/mapreduce/trunk/src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/TestFairScheduler.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/TestFairScheduler.java?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/TestFairScheduler.java
(original)
+++ hadoop/mapreduce/trunk/src/contrib/fairscheduler/src/test/org/apache/hadoop/mapred/TestFairScheduler.java
Tue May 31 16:06:25 2011
@@ -38,6 +38,7 @@ import junit.framework.TestCase;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.BytesWritable;
 import org.apache.hadoop.mapred.FairScheduler.JobInfo;
+import org.apache.hadoop.mapreduce.Cluster.JobTrackerStatus;
 import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapred.FakeObjectUtilities.FakeJobHistory;
 import org.apache.hadoop.mapred.JobInProgress.KillInterruptedException;
@@ -374,7 +375,7 @@ public class TestFairScheduler extends T
           ttExpiryInterval, maps, reduces,
           numTrackers * maxMapTasksPerTracker,
           numTrackers * maxReduceTasksPerTracker,
-          JobTracker.State.RUNNING);
+          JobTrackerStatus.RUNNING);
     }
 
     @Override

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/ClusterStatus.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/ClusterStatus.java?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/ClusterStatus.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/ClusterStatus.java Tue May 31
16:06:25 2011
@@ -185,7 +185,7 @@ public class ClusterStatus implements Wr
   private int reduce_tasks;
   private int max_map_tasks;
   private int max_reduce_tasks;
-  private JobTracker.State state;
+  private JobTrackerStatus status;
   private Collection<BlackListInfo> blacklistedTrackersInfo =
     new ArrayList<BlackListInfo>();
 
@@ -201,13 +201,13 @@ public class ClusterStatus implements Wr
    * @param reduces no. of currently running reduce-tasks in the cluster
    * @param maxMaps the maximum no. of map tasks in the cluster
    * @param maxReduces the maximum no. of reduce tasks in the cluster
-   * @param state the {@link JobTracker.State} of the <code>JobTracker</code>
+   * @param status the {@link JobTrackerStatus} of the <code>JobTracker</code>
    */
   ClusterStatus(int trackers, int blacklists, long ttExpiryInterval, 
                 int maps, int reduces,
-                int maxMaps, int maxReduces, JobTracker.State state) {
+                int maxMaps, int maxReduces, JobTrackerStatus status) {
     this(trackers, blacklists, ttExpiryInterval, maps, reduces, maxMaps, 
-         maxReduces, state, 0);
+         maxReduces, status, 0);
   }
 
   /**
@@ -220,12 +220,12 @@ public class ClusterStatus implements Wr
    * @param reduces no. of currently running reduce-tasks in the cluster
    * @param maxMaps the maximum no. of map tasks in the cluster
    * @param maxReduces the maximum no. of reduce tasks in the cluster
-   * @param state the {@link JobTracker.State} of the <code>JobTracker</code>
+   * @param status the {@link JobTrackerStatus} of the <code>JobTracker</code>
    * @param numDecommissionedNodes number of decommission trackers
    */
   ClusterStatus(int trackers, int blacklists, long ttExpiryInterval, 
                 int maps, int reduces, int maxMaps, int maxReduces, 
-                JobTracker.State state, int numDecommissionedNodes) {
+                JobTrackerStatus status, int numDecommissionedNodes) {
     numActiveTrackers = trackers;
     numBlacklistedTrackers = blacklists;
     this.numExcludedNodes = numDecommissionedNodes;
@@ -234,7 +234,7 @@ public class ClusterStatus implements Wr
     reduce_tasks = reduces;
     max_map_tasks = maxMaps;
     max_reduce_tasks = maxReduces;
-    this.state = state;
+    this.status = status;
   }
 
   /**
@@ -247,15 +247,15 @@ public class ClusterStatus implements Wr
    * @param reduces no. of currently running reduce-tasks in the cluster
    * @param maxMaps the maximum no. of map tasks in the cluster
    * @param maxReduces the maximum no. of reduce tasks in the cluster
-   * @param state the {@link JobTracker.State} of the <code>JobTracker</code>
+   * @param status the {@link JobTrackerStatus} of the <code>JobTracker</code>
    */
   ClusterStatus(Collection<String> activeTrackers, 
       Collection<BlackListInfo> blacklistedTrackers,
       long ttExpiryInterval,
       int maps, int reduces, int maxMaps, int maxReduces, 
-      JobTracker.State state) {
+      JobTrackerStatus status) {
     this(activeTrackers, blacklistedTrackers, ttExpiryInterval, maps, reduces, 
-         maxMaps, maxReduces, state, 0);
+         maxMaps, maxReduces, status, 0);
   }
 
 
@@ -270,16 +270,16 @@ public class ClusterStatus implements Wr
    * @param reduces no. of currently running reduce-tasks in the cluster
    * @param maxMaps the maximum no. of map tasks in the cluster
    * @param maxReduces the maximum no. of reduce tasks in the cluster
-   * @param state the {@link JobTracker.State} of the <code>JobTracker</code>
+   * @param status the {@link JobTrackerStatus} of the <code>JobTracker</code>
    * @param numDecommissionNodes number of decommission trackers
    */
   
   ClusterStatus(Collection<String> activeTrackers,
       Collection<BlackListInfo> blackListedTrackerInfo, long ttExpiryInterval,
       int maps, int reduces, int maxMaps, int maxReduces,
-      JobTracker.State state, int numDecommissionNodes) {
+      JobTrackerStatus status, int numDecommissionNodes) {
     this(activeTrackers.size(), blackListedTrackerInfo.size(),
-        ttExpiryInterval, maps, reduces, maxMaps, maxReduces, state,
+        ttExpiryInterval, maps, reduces, maxMaps, maxReduces, status,
         numDecommissionNodes);
     this.activeTrackers = activeTrackers;
     this.blacklistedTrackersInfo = blackListedTrackerInfo;
@@ -378,24 +378,12 @@ public class ClusterStatus implements Wr
   }
   
   /**
-   * Get the current state of the <code>JobTracker</code>, 
-   * as {@link JobTracker.State}
-   * 
-   * @return the current state of the <code>JobTracker</code>.
-   * @deprecated Use {@link #getJobTrackerStatus()} instead.
-   */
-  @Deprecated
-  public JobTracker.State getJobTrackerState() {
-    return state;
-  }
-  
-  /**
    * Get the JobTracker's status.
    * 
    * @return {@link JobTrackerStatus} of the JobTracker
    */
   public JobTrackerStatus getJobTrackerStatus() {
-    return JobTrackerStatus.valueOf(state.name());
+    return status;
   }
 
   /**
@@ -435,7 +423,7 @@ public class ClusterStatus implements Wr
     out.writeInt(reduce_tasks);
     out.writeInt(max_map_tasks);
     out.writeInt(max_reduce_tasks);
-    WritableUtils.writeEnum(out, state);
+    WritableUtils.writeEnum(out, status);
   }
 
   public void readFields(DataInput in) throws IOException {
@@ -462,6 +450,6 @@ public class ClusterStatus implements Wr
     reduce_tasks = in.readInt();
     max_map_tasks = in.readInt();
     max_reduce_tasks = in.readInt();
-    state = WritableUtils.readEnum(in, JobTracker.State.class);
+    status = WritableUtils.readEnum(in, JobTrackerStatus.class);
   }
 }

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobClient.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobClient.java?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobClient.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobClient.java Tue May 31 16:06:25
2011
@@ -686,7 +686,7 @@ public class JobClient extends CLI {
         metrics.getOccupiedMapSlots(),
         metrics.getOccupiedReduceSlots(), metrics.getMapSlotCapacity(),
         metrics.getReduceSlotCapacity(),
-        JobTracker.State.valueOf(cluster.getJobTrackerState().name()),
+        cluster.getJobTrackerStatus(),
         metrics.getDecommissionedTaskTrackerCount());
     } catch (InterruptedException ie) {
       throw new IOException(ie);
@@ -730,7 +730,7 @@ public class JobClient extends CLI {
         cluster.getTaskTrackerExpiryInterval(), metrics.getOccupiedMapSlots(),
         metrics.getOccupiedReduceSlots(), metrics.getMapSlotCapacity(),
         metrics.getReduceSlotCapacity(), 
-        JobTracker.State.valueOf(cluster.getJobTrackerState().name()));
+        cluster.getJobTrackerStatus());
     } catch (InterruptedException ie) {
       throw new IOException(ie);
     }

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java Tue May 31 16:06:25
2011
@@ -3255,7 +3255,7 @@ public class JobTracker implements MRCon
             totalReduces,
             totalMapTaskCapacity,
             totalReduceTaskCapacity, 
-            state, getExcludedNodes().size()
+            JobTrackerStatus.valueOf(state.name()), getExcludedNodes().size()
             );
       } else {
         return new ClusterStatus(taskTrackers.size() - 
@@ -3266,7 +3266,7 @@ public class JobTracker implements MRCon
             totalReduces,
             totalMapTaskCapacity,
             totalReduceTaskCapacity, 
-            state, getExcludedNodes().size());          
+            JobTrackerStatus.valueOf(state.name()), getExcludedNodes().size());
       }
     }
   }

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/FakeObjectUtilities.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/FakeObjectUtilities.java?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/FakeObjectUtilities.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/FakeObjectUtilities.java
Tue May 31 16:06:25 2011
@@ -29,6 +29,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.mapred.TaskStatus.Phase;
+import org.apache.hadoop.mapreduce.Cluster.JobTrackerStatus;
 import org.apache.hadoop.mapreduce.TaskType;
 import org.apache.hadoop.mapreduce.jobhistory.HistoryEvent;
 import org.apache.hadoop.mapreduce.jobhistory.JobHistory;
@@ -66,7 +67,7 @@ public class FakeObjectUtilities {
       return new ClusterStatus(
           taskTrackers().size() - getBlacklistedTrackerCount(),
           getBlacklistedTrackerCount(), 0, 0, 0, totalSlots/2, totalSlots/2, 
-           JobTracker.State.RUNNING, 0);
+           JobTrackerStatus.RUNNING, 0);
     }
 
     public void setNumSlots(int totalSlots) {

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestJobInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestJobInProgress.java?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestJobInProgress.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestJobInProgress.java
Tue May 31 16:06:25 2011
@@ -41,6 +41,7 @@ import org.apache.hadoop.mapred.FakeObje
 import org.apache.hadoop.mapred.FakeObjectUtilities.FakeJobTracker;
 import org.apache.hadoop.mapred.TaskStatus.Phase;
 import org.apache.hadoop.mapred.UtilsForTests.FakeClock;
+import org.apache.hadoop.mapreduce.Cluster.JobTrackerStatus;
 import org.apache.hadoop.mapreduce.JobCounter;
 import org.apache.hadoop.mapreduce.TaskType;
 import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;
@@ -317,7 +318,7 @@ public class TestJobInProgress extends T
     verify(jspy, times(4)).setFirstTaskLaunchTime(any(TaskInProgress.class));
 
     ClusterStatus cspy = spy(new ClusterStatus(4, 0, 0, 0, 0, 4, 4,
-                                               JobTracker.State.RUNNING, 0));
+        JobTrackerStatus.RUNNING, 0));
 
     JobInProgress.JobSummary.logJobSummary(jspy, cspy);
 

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestJobQueueTaskScheduler.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestJobQueueTaskScheduler.java?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestJobQueueTaskScheduler.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestJobQueueTaskScheduler.java
Tue May 31 16:06:25 2011
@@ -28,6 +28,7 @@ import junit.framework.TestCase;
 
 import org.apache.hadoop.io.BytesWritable;
 import org.apache.hadoop.mapred.JobStatusChangeEvent.EventType;
+import org.apache.hadoop.mapreduce.Cluster.JobTrackerStatus;
 import org.apache.hadoop.mapreduce.TaskType;
 import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;
 import org.apache.hadoop.mapreduce.server.jobtracker.TaskTracker;
@@ -156,7 +157,7 @@ public class TestJobQueueTaskScheduler e
                                maps, reduces,
                                numTrackers * maxMapTasksPerTracker,
                                numTrackers * maxReduceTasksPerTracker,
-                               JobTracker.State.RUNNING);
+                               JobTrackerStatus.RUNNING);
     }
 
     @Override

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestParallelInitialization.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestParallelInitialization.java?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestParallelInitialization.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestParallelInitialization.java
Tue May 31 16:06:25 2011
@@ -30,6 +30,7 @@ import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.mapred.FakeObjectUtilities.FakeJobHistory;
 import org.apache.hadoop.mapred.JobInProgress.KillInterruptedException;
 import org.apache.hadoop.mapred.JobStatusChangeEvent.EventType;
+import org.apache.hadoop.mapreduce.Cluster.JobTrackerStatus;
 import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;
 
 public class TestParallelInitialization extends TestCase {
@@ -107,7 +108,7 @@ public class TestParallelInitialization 
                                maps, reduces,
                                numTrackers * maxMapTasksPerTracker,
                                numTrackers * maxReduceTasksPerTracker,
-                               JobTracker.State.RUNNING);
+                               JobTrackerStatus.RUNNING);
     }
     
     public int getNumberOfUniqueHosts() {

Modified: hadoop/mapreduce/trunk/src/webapps/job/jobtracker.jsp
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/webapps/job/jobtracker.jsp?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/webapps/job/jobtracker.jsp (original)
+++ hadoop/mapreduce/trunk/src/webapps/job/jobtracker.jsp Tue May 31 16:06:25 2011
@@ -124,7 +124,7 @@
   </ul>
 </div>
 
-<b>State:</b> <%= status.getJobTrackerState() %><br>
+<b>State:</b> <%= status.getJobTrackerStatus() %><br>
 <b>Started:</b> <%= new Date(tracker.getStartTime())%><br>
 <b>Version:</b> <%= VersionInfo.getVersion()%>,
                 <%= VersionInfo.getRevision()%><br>

Modified: hadoop/mapreduce/trunk/src/webapps/job/jobtracker.jspx
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/webapps/job/jobtracker.jspx?rev=1129771&r1=1129770&r2=1129771&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/webapps/job/jobtracker.jspx (original)
+++ hadoop/mapreduce/trunk/src/webapps/job/jobtracker.jspx Tue May 31 16:06:25 2011
@@ -49,7 +49,7 @@
     <tracker_name><jsp:expression>trackerName</jsp:expression></tracker_name>
 
     <tracker>
-      <state><jsp:expression>tracker.getClusterStatus().getJobTrackerState()</jsp:expression></state>
+      <state><jsp:expression>tracker.getClusterStatus().getJobTrackerStatus()</jsp:expression></state>
       <started><jsp:expression>new Date(tracker.getStartTime())</jsp:expression></started>
       <version><jsp:expression>VersionInfo.getVersion()</jsp:expression></version>
       <revision><jsp:expression>VersionInfo.getRevision()</jsp:expression></revision>



Mime
View raw message