incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1049431 - in /incubator/hama/trunk/src/java/org/apache/hama/bsp: JobInProgress.java JobStatus.java
Date Wed, 15 Dec 2010 05:12:19 GMT
Author: edwardyoon
Date: Wed Dec 15 05:12:19 2010
New Revision: 1049431

URL: http://svn.apache.org/viewvc?rev=1049431&view=rev
Log:
Add setFinishTime() method

Modified:
    incubator/hama/trunk/src/java/org/apache/hama/bsp/JobInProgress.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/JobStatus.java

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=1049431&r1=1049430&r2=1049431&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 05:12:19
2010
@@ -214,10 +214,13 @@ class JobInProgress {
     }
 
     if (allDone) {
-      LOG.debug("Job successfully done.");
-
       this.status = new JobStatus(this.status.getJobID(), this.profile
           .getUser(), 1.0f, 1.0f, 1.0f, JobStatus.SUCCEEDED, superstepCounter);
+      this.finishTime = System.currentTimeMillis();
+      this.status.setFinishTime(this.finishTime);
+      
+      LOG.debug("Job successfully done.");
+      
       garbageCollect();
     }
   }
@@ -239,7 +242,7 @@ class JobInProgress {
       this.status = new JobStatus(status.getJobID(), this.profile.getUser(),
           1.0f, 1.0f, 1.0f, JobStatus.FAILED);
       this.finishTime = System.currentTimeMillis();
-
+      this.status.setFinishTime(this.finishTime);
       //
       // kill all TIPs.
       //

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/JobStatus.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/JobStatus.java?rev=1049431&r1=1049430&r2=1049431&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/JobStatus.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/JobStatus.java Wed Dec 15 05:12:19 2010
@@ -50,6 +50,8 @@ public class JobStatus implements Writab
   private String schedulingInfo = "NA";
   private String user;
   private long superstepCount;
+
+  private long finishTime;
   
   public JobStatus() {
   }
@@ -127,6 +129,17 @@ public class JobStatus implements Writab
     return startTime;
   }
 
+  public synchronized void setFinishTime(long finishTime) {
+    this.finishTime = finishTime;
+  }
+  
+  /**
+   * Get the finish time of the job.
+   */
+  public synchronized long getFinishTime() { 
+    return finishTime;
+  }
+  
   /**
    * @param user The username of the job
    */
@@ -169,6 +182,7 @@ public class JobStatus implements Writab
     out.writeFloat(cleanupProgress);
     out.writeInt(runState);
     out.writeLong(startTime);
+    out.writeLong(finishTime);
     Text.writeString(out, user);
     Text.writeString(out, schedulingInfo);
     out.writeLong(superstepCount);
@@ -182,6 +196,7 @@ public class JobStatus implements Writab
     this.cleanupProgress = in.readFloat();
     this.runState = in.readInt();
     this.startTime = in.readLong();
+    this.finishTime = in.readLong();
     this.user = Text.readString(in);
     this.schedulingInfo = Text.readString(in);
     this.superstepCount = in.readLong();



Mime
View raw message