incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1200325 - in /incubator/hama/trunk: CHANGES.txt core/src/main/java/org/apache/hama/bsp/BSPJobClient.java core/src/main/java/org/apache/hama/bsp/BSPMaster.java
Date Thu, 10 Nov 2011 13:31:34 GMT
Author: edwardyoon
Date: Thu Nov 10 13:31:33 2011
New Revision: 1200325

URL: http://svn.apache.org/viewvc?rev=1200325&view=rev
Log:
ClusterStatus.getTasks() always returns 0

Modified:
    incubator/hama/trunk/CHANGES.txt
    incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java
    incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPMaster.java

Modified: incubator/hama/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/CHANGES.txt?rev=1200325&r1=1200324&r2=1200325&view=diff
==============================================================================
--- incubator/hama/trunk/CHANGES.txt (original)
+++ incubator/hama/trunk/CHANGES.txt Thu Nov 10 13:31:33 2011
@@ -15,6 +15,7 @@ Release 0.4 - Unreleased
 
   BUG FIXES
 
+    HAMA-474: ClusterStatus.getTasks() always returns 0 (edwardyoon)
     HAMA-472: The task should be killed if it fails to initialize (edwardyoon)
     HAMA-465: LocalJobRunner should support combiners and IO (tjungblut)
     HAMA-459: GroomServerStatus.countTask() always returns 1 (edwardyoon)

Modified: incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java?rev=1200325&r1=1200324&r2=1200325&view=diff
==============================================================================
--- incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java (original)
+++ incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java Thu Nov
10 13:31:33 2011
@@ -595,7 +595,15 @@ public class BSPJobClient extends Config
     while (!job.isComplete()) {
       Thread.sleep(3000);
       long step = job.progress();
-      String report = "Current supersteps number: " + step;
+      String report = "";
+
+      if (step == 0) {
+        report = "Wait for tasks that have not yet been activated: "
+            + ((getClusterStatus(false).getTasks() / job.getNumBspTask()) * 100)
+            + "%";
+      } else {
+        report = "Current supersteps number: " + step;
+      }
 
       if (!report.equals(lastReport)) {
         LOG.info(report);

Modified: incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPMaster.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPMaster.java?rev=1200325&r1=1200324&r2=1200325&view=diff
==============================================================================
--- incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPMaster.java (original)
+++ incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPMaster.java Thu Nov 10
13:31:33 2011
@@ -143,12 +143,16 @@ public class BSPMaster implements JobSub
         GroomServerStatus tmpStatus = null;
         for (GroomServerStatus old : groomServers.keySet()) {
           if (old.equals(groomStatus)) {
+            totalTasks -= old.countTasks();
             tmpStatus = groomStatus;
             updateGroomServersKey(old, tmpStatus);
             break;
           }
-        }// for
+        }
+        
         if (null != tmpStatus) {
+          totalTasks += tmpStatus.countTasks();
+          
           List<TaskStatus> tlist = tmpStatus.getTaskReports();
           for (TaskStatus ts : tlist) {
             JobInProgress jip = whichJob(ts.getJobId());
@@ -637,7 +641,6 @@ public class BSPMaster implements JobSub
         GroomServerStatus s = entry.getKey();
         groomsMap.put(s.getGroomHostName() + ":" + Constants.DEFAULT_PEER_PORT, s);
       }
-
     }
 
     int tasksPerGroom = conf.getInt(Constants.MAX_TASKS_PER_GROOM, 3);



Mime
View raw message