hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhema...@apache.org
Subject svn commit: r712615 - in /hadoop/core/trunk: CHANGES.txt src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacityTaskScheduler.java src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java
Date Mon, 10 Nov 2008 06:34:08 GMT
Author: yhemanth
Date: Sun Nov  9 22:34:08 2008
New Revision: 712615

URL: http://svn.apache.org/viewvc?rev=712615&view=rev
Log:
HADOOP-4446. Modify guaranteed capacity labels in capacity scheduler's UI to reflect the information
being displayed. Contributed by Sreekanth Ramakrishnan

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacityTaskScheduler.java
    hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=712615&r1=712614&r2=712615&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Sun Nov  9 22:34:08 2008
@@ -1070,6 +1070,10 @@
     HADOOP-4498. Ensure that JobHistory correctly escapes the job name so that
     regex patterns work. (Chris Wensel via acmurthy)
 
+    HADOOP-4446. Modify guaranteed capacity labels in capacity scheduler's UI
+    to reflect the information being displayed. (Sreekanth Ramakrishnan via 
+    yhemanth)
+
 Release 0.18.3 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/trunk/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacityTaskScheduler.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacityTaskScheduler.java?rev=712615&r1=712614&r2=712615&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacityTaskScheduler.java
(original)
+++ hadoop/core/trunk/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacityTaskScheduler.java
Sun Nov  9 22:34:08 2008
@@ -33,7 +33,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapred.JobStatusChangeEvent.EventType;
 import org.apache.hadoop.mapred.JobTracker.IllegalStateException;
 import org.apache.hadoop.util.StringUtils;
 
@@ -207,17 +206,13 @@
     
     @Override
     public String toString(){
-      String queue = mqsi.queueName;
       StringBuffer sb = new StringBuffer();
-      sb.append("Guaranteed Capacity Maps (%) :");
+      sb.append("Guaranteed Capacity (%) : ");
       sb.append(mqsi.guaranteedCapacityPercent);
-      sb.append("\n");
-      sb.append("Guaranteed Capacity Reduces (%) :");
-      sb.append(rqsi.guaranteedCapacityPercent);
-      sb.append("\n");
-      sb.append(String.format("Current Capacity Maps : %d \n",
+      sb.append(" \n");
+      sb.append(String.format("Guaranteed Capacity Maps : %d \n",
           mqsi.guaranteedCapacity));
-      sb.append(String.format("Current Capacity Reduces : %d \n",
+      sb.append(String.format("Guaranteed Capacity Reduces : %d \n",
           rqsi.guaranteedCapacity));
       sb.append(String.format("User Limit : %d \n",mqsi.ulMin));
       sb.append(String.format("Reclaim Time limit : %d \n",mqsi.reclaimTime));

Modified: hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java?rev=712615&r1=712614&r2=712615&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java
(original)
+++ hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java
Sun Nov  9 22:34:08 2008
@@ -783,7 +783,7 @@
                                           String queue) throws IOException {
     String schedInfo = taskTrackerManager.getQueueManager().
                           getSchedulerInfo(queue).toString();
-    assertTrue(schedInfo.contains("Current Capacity Maps : " 
+    assertTrue(schedInfo.contains("Guaranteed Capacity Maps : " 
                                     + expectedCapacity));
   }
   
@@ -1116,6 +1116,38 @@
     assertEquals(j1.runningMapTasks, 2);
     
   }
+  
+  public void testSchedulingInformation() throws IOException {
+    String[] qs = {"default", "q2"};
+    taskTrackerManager.addQueues(qs);
+    resConf = new FakeResourceManagerConf();
+    ArrayList<FakeQueueInfo> queues = new ArrayList<FakeQueueInfo>();
+    queues.add(new FakeQueueInfo("default", 50.0f, 1000000, true, 25));
+    queues.add(new FakeQueueInfo("q2", 50.0f, 1000000, true, 25));
+    resConf.setFakeQueues(queues);
+    scheduler.setResourceManagerConf(resConf);
+    scheduler.start();
+    scheduler.assignTasks(tracker("tt1")); // heartbeat
+    scheduler.assignTasks(tracker("tt2")); // heartbeat
+    int totalMaps = taskTrackerManager.getClusterStatus().getMaxMapTasks();
+    int totalReduces = taskTrackerManager.getClusterStatus().getMaxReduceTasks();
+    QueueManager queueManager = scheduler.taskTrackerManager.getQueueManager();
+    String schedulingInfo = queueManager.getJobQueueInfo("default").getSchedulingInfo();
+    String schedulingInfo2 = queueManager.getJobQueueInfo("q2").getSchedulingInfo();
+    String[] infoStrings = schedulingInfo.split("\n");
+    assertEquals(infoStrings.length, 10);
+    assertEquals(infoStrings[0] , "Guaranteed Capacity (%) : 50.0 ");
+    assertEquals(infoStrings[1] , "Guaranteed Capacity Maps : " + totalMaps * 50/100 + "
");
+    assertEquals(infoStrings[2] , "Guaranteed Capacity Reduces : " + totalReduces * 50/100
+ " ");
+    assertEquals(infoStrings[3] , "User Limit : 25 ");
+    assertEquals(infoStrings[4] , "Reclaim Time limit : 1000000 " );
+    assertEquals(infoStrings[5] , "Number of Running Maps : 0 ");
+    assertEquals(infoStrings[6] , "Number of Running Reduces : 0 ");
+    assertEquals(infoStrings[7] , "Number of Waiting Maps : 0 ");
+    assertEquals(infoStrings[8] , "Number of Waiting Reduces : 0 ");
+    assertEquals(infoStrings[9] , "Priority Supported : YES ");
+    assertEquals(schedulingInfo, schedulingInfo2);   
+  }
 
   protected TaskTrackerStatus tracker(String taskTrackerName) {
     return taskTrackerManager.getTaskTracker(taskTrackerName);



Mime
View raw message