incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1049476 - in /incubator/hama/trunk: CHANGES.txt src/java/org/apache/hama/bsp/JobInProgress.java src/java/org/apache/hama/bsp/TaskInProgress.java
Date Wed, 15 Dec 2010 10:32:12 GMT
Author: edwardyoon
Date: Wed Dec 15 10:32:12 2010
New Revision: 1049476

URL: http://svn.apache.org/viewvc?rev=1049476&view=rev
Log:
Task successfully finished but system re-attempt

Modified:
    incubator/hama/trunk/CHANGES.txt
    incubator/hama/trunk/src/java/org/apache/hama/bsp/JobInProgress.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/TaskInProgress.java

Modified: incubator/hama/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/CHANGES.txt?rev=1049476&r1=1049475&r2=1049476&view=diff
==============================================================================
--- incubator/hama/trunk/CHANGES.txt (original)
+++ incubator/hama/trunk/CHANGES.txt Wed Dec 15 10:32:12 2010
@@ -191,6 +191,7 @@ Trunk (unreleased changes)
 
   BUG FIXES
   
+    HAMA-344: Task successfully finished but system re-attempt (edwardyoon)
     HAMA-343: Fix Maven test fails (Tommaso Teofili via edwardyoon)
     HAMA-338: Username and Job-manager states are not collectly displayed (edwardyoon)
     HAMA-330: BSP program doesn't work when the desired tasks smaller than 

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/JobInProgress.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/JobInProgress.java?rev=1049476&r1=1049475&r2=1049476&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/JobInProgress.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/JobInProgress.java Wed Dec 15 10:32:12
2010
@@ -182,7 +182,7 @@ class JobInProgress {
     Task result = null;
     try {
       for (int i = 0; i < tasks.length; i++) {
-        if (!tasks[i].isRunning()) {
+        if (!tasks[i].isRunning() && !tasks[i].isComplete()) {
           result = tasks[i].getTaskToRun(status);
           break;
         }

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/TaskInProgress.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/TaskInProgress.java?rev=1049476&r1=1049475&r2=1049476&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/TaskInProgress.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/TaskInProgress.java Wed Dec 15 10:32:12
2010
@@ -57,7 +57,7 @@ class TaskInProgress {
   int nextTaskId = 0;
 
   // The taskid that took this TIP to SUCCESS
-  // private TaskAttemptID successfulTaskId;
+  private TaskAttemptID successfulTaskId;
 
   // The first taskid of this tip
   private TaskAttemptID firstTaskId;
@@ -164,6 +164,16 @@ class TaskInProgress {
   public synchronized boolean isComplete() {
     return (completes > 0);
   }
+  
+  /**
+   * Is the given taskid the one that took this tip to completion?
+   * 
+   * @param taskid taskid of attempt to check for completion
+   * @return <code>true</code> if taskid is complete, else <code>false</code>
+   */
+  public boolean isComplete(TaskAttemptID taskid) {
+    return (completes > 0 && taskid.equals(getSuccessfulTaskid()));
+  }
 
   private TreeSet<TaskAttemptID> tasksReportedClosed = new TreeSet<TaskAttemptID>();
 
@@ -180,10 +190,14 @@ class TaskInProgress {
 
   public void completed(TaskAttemptID taskid) {
     LOG.info("Task '" + taskid.getTaskID().toString() + "' has completed.");
+    
     TaskStatus status = (TaskStatus) taskStatuses.get(taskid);
     status.setRunState(TaskStatus.State.SUCCEEDED);
     activeTasks.remove(taskid);
 
+    // Note the successful taskid
+    setSuccessfulTaskid(taskid);
+    
     //
     // Now that the TIP is complete, the other speculative
     // subtasks will be closed when the owning groom server
@@ -193,6 +207,14 @@ class TaskInProgress {
     this.completes++;
   }
 
+  private void setSuccessfulTaskid(TaskAttemptID taskid) {
+    this.successfulTaskId = taskid; 
+  }
+
+  private TaskAttemptID getSuccessfulTaskid() {
+    return successfulTaskId;
+  }
+  
   public void updateStatus(TaskStatus status) {
     taskStatuses.put(status.getTaskId(), status);
   }



Mime
View raw message