incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1045056 - in /incubator/hama/trunk: ./ src/java/org/apache/hama/bsp/
Date Mon, 13 Dec 2010 10:42:55 GMT
Author: edwardyoon
Date: Mon Dec 13 10:42:55 2010
New Revision: 1045056

URL: http://svn.apache.org/viewvc?rev=1045056&view=rev
Log:
Username and Job-manager states are not collectly displayed

Modified:
    incubator/hama/trunk/CHANGES.txt
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/JobInProgress.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/JobStatus.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=1045056&r1=1045055&r2=1045056&view=diff
==============================================================================
--- incubator/hama/trunk/CHANGES.txt (original)
+++ incubator/hama/trunk/CHANGES.txt Mon Dec 13 10:42:55 2010
@@ -191,6 +191,7 @@ Trunk (unreleased changes)
 
   BUG FIXES
   
+    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 
                        cluster size (edwardyoon)
     HAMA-326: GroomServer should wait until a job finishes (edwardyoon)

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java?rev=1045056&r1=1045055&r2=1045056&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java Mon Dec 13 10:42:55
2010
@@ -526,9 +526,6 @@ public class BSPJobClient extends Config
       System.err.println(prefix + "[" + cmd + " <job-file>]");
     } else if ("-status".equals(cmd) || "-kill".equals(cmd)) {
       System.err.println(prefix + "[" + cmd + " <job-id>]");
-    } else if ("-counter".equals(cmd)) {
-      System.err.println(prefix + "[" + cmd
-          + " <job-id> <group-name> <counter-name>]");
     } else if ("-events".equals(cmd)) {
       System.err.println(prefix + "[" + cmd
           + " <job-id> <from-event-#> <#-of-events>]");
@@ -548,7 +545,6 @@ public class BSPJobClient extends Config
       System.err.printf(prefix + "<command> <args>\n");
       System.err.printf("\t[-submit <job-file>]\n");
       System.err.printf("\t[-status <job-id>]\n");
-      System.err.printf("\t[-counter <job-id> <group-name> <counter-name>]\n");
       System.err.printf("\t[-kill <job-id>]\n");
       System.err.printf("\t[-events <job-id> <from-event-#> <#-of-events>]\n");
       System.err.printf("\t[-history <jobOutputDir>]\n");

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java?rev=1045056&r1=1045055&r2=1045056&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java Mon Dec 13 10:42:55 2010
@@ -600,6 +600,11 @@ public class BSPMaster implements JobSub
     List<JobStatus> jobStatusList = new ArrayList<JobStatus>();
     for (JobInProgress jip : jips) {
       JobStatus status = jip.getStatus();
+      
+      status.setStartTime(jip.getStartTime());
+      // Sets the user name
+      status.setUsername(jip.getProfile().getUser());
+      
       if (toComplete) {
         if (status.getRunState() == JobStatus.RUNNING
             || status.getRunState() == JobStatus.PREP) {

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=1045056&r1=1045055&r2=1045056&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 Mon Dec 13 10:42:55
2010
@@ -55,7 +55,7 @@ class JobInProgress {
   private LocalFileSystem localFs;
   // Indicates how many times the job got restarted
   private int restartCount;
-  
+
   long startTime;
   long launchTime;
   long finishTime;
@@ -68,7 +68,7 @@ class JobInProgress {
 
   int numBSPTasks = 0;
   int clusterSize;
-  
+
   public JobInProgress(BSPJobID jobId, BSPMaster master, Configuration conf)
       throws IOException {
     this.conf = conf;
@@ -76,13 +76,11 @@ class JobInProgress {
     this.localFs = FileSystem.getLocal(conf);
 
     this.master = master;
-    this.status = new JobStatus(jobId, 0.0f, 0.0f, JobStatus.PREP);
+    this.status = new JobStatus(jobId, null, 0.0f, 0.0f, JobStatus.PREP);
     this.startTime = System.currentTimeMillis();
-    status.setStartTime(startTime);
-    
     this.superstepCounter = 0;
     this.restartCount = 0;
-    
+
     this.localJobFile = master.getLocalPath(BSPMaster.SUBDIR + "/" + jobId
         + ".xml");
     this.localJarFile = master.getLocalPath(BSPMaster.SUBDIR + "/" + jobId
@@ -98,6 +96,9 @@ class JobInProgress {
     this.profile = new JobProfile(job.getUser(), jobId, jobFile.toString(), job
         .getJobName());
 
+    status.setUsername(job.getUser());
+    status.setStartTime(startTime);
+
     String jarFile = job.getJar();
     if (jarFile != null) {
       fs.copyToLocalFile(new Path(jarFile), localJarFile);
@@ -162,8 +163,8 @@ class JobInProgress {
     }
 
     // Update job status
-    this.status = new JobStatus(this.status.getJobID(), 1.0f, 1.0f,
-        JobStatus.RUNNING);
+    this.status = new JobStatus(this.status.getJobID(), this.profile.getUser(),
+        1.0f, 1.0f, JobStatus.RUNNING);
 
     tasksInited = true;
     LOG.debug("Job is initialized.");
@@ -215,8 +216,8 @@ class JobInProgress {
     if (allDone) {
       LOG.debug("Job successfully done.");
 
-      this.status = new JobStatus(this.status.getJobID(), 1.0f, 1.0f, 1.0f,
-          JobStatus.SUCCEEDED, superstepCounter);
+      this.status = new JobStatus(this.status.getJobID(), this.profile
+          .getUser(), 1.0f, 1.0f, 1.0f, JobStatus.SUCCEEDED, superstepCounter);
       garbageCollect();
     }
   }
@@ -235,8 +236,8 @@ class JobInProgress {
   public synchronized void kill() {
     LOG.debug(">> JobInProgress.kill() step.");
     if (status.getRunState() != JobStatus.FAILED) {
-      this.status = new JobStatus(status.getJobID(), 1.0f, 1.0f, 1.0f,
-          JobStatus.FAILED);
+      this.status = new JobStatus(status.getJobID(), this.profile.getUser(),
+          1.0f, 1.0f, 1.0f, JobStatus.FAILED);
       this.finishTime = System.currentTimeMillis();
 
       //
@@ -283,5 +284,5 @@ class JobInProgress {
   int getNumRestarts() {
     return restartCount;
   }
-  
+
 }

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=1045056&r1=1045055&r2=1045056&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 Mon Dec 13 10:42:55 2010
@@ -18,7 +18,6 @@
 package org.apache.hama.bsp;
 
 import java.io.DataInput;
-
 import java.io.DataOutput;
 import java.io.IOException;
 
@@ -28,7 +27,6 @@ import org.apache.hadoop.io.WritableFact
 import org.apache.hadoop.io.WritableFactory;
 
 public class JobStatus implements Writable, Cloneable {
-
   static {
     WritableFactories.setFactory(JobStatus.class, new WritableFactory() {
       public Writable newInstance() {
@@ -56,21 +54,21 @@ public class JobStatus implements Writab
   public JobStatus() {
   }
 
-  public JobStatus(BSPJobID jobid, float progress, int runState) {
-    this(jobid, progress, 0.0f, runState);
+  public JobStatus(BSPJobID jobid, String user, float progress, int runState) {
+    this(jobid, user, progress, 0.0f, runState);
   }
 
-  public JobStatus(BSPJobID jobid, float progress, float cleanupProgress,
+  public JobStatus(BSPJobID jobid, String user, float progress, float cleanupProgress,
       int runState) {
-    this(jobid, 0.0f, progress, cleanupProgress, runState);
+    this(jobid, user, 0.0f, progress, cleanupProgress, runState);
   }
 
-  public JobStatus(BSPJobID jobid, float setupProgress, float progress,
+  public JobStatus(BSPJobID jobid, String user, float setupProgress, float progress,
       float cleanupProgress, int runState) {
-    this(jobid, 0.0f, progress, cleanupProgress, runState, 0);
+    this(jobid, user, 0.0f, progress, cleanupProgress, runState, 0);
   }
 
-  public JobStatus(BSPJobID jobid, float setupProgress, float progress,
+  public JobStatus(BSPJobID jobid, String user, float setupProgress, float progress,
       float cleanupProgress, int runState, long superstepCount) {
     this.jobid = jobid;
     this.setupProgress = setupProgress;
@@ -78,6 +76,7 @@ public class JobStatus implements Writab
     this.cleanupProgress = cleanupProgress;
     this.runState = runState;
     this.superstepCount = superstepCount;
+    this.user = user;
   }
   
   public BSPJobID getJobID() {
@@ -120,26 +119,26 @@ public class JobStatus implements Writab
     return superstepCount;
   }
   
-  synchronized void setStartTime(long startTime) {
+  public synchronized void setStartTime(long startTime) {
     this.startTime = startTime;
   }
 
-  synchronized public long getStartTime() {
+  public synchronized long getStartTime() {
     return startTime;
   }
 
   /**
    * @param user The username of the job
    */
-  synchronized void setUsername(String userName) {
-    this.user = userName;
+  public synchronized void setUsername(String user) {
+    this.user = user;
   }
 
   /**
    * @return the username of the job
    */
   public synchronized String getUsername() {
-    return this.user;
+    return user;
   }
 
   @Override
@@ -170,6 +169,7 @@ public class JobStatus implements Writab
     out.writeFloat(cleanupProgress);
     out.writeInt(runState);
     out.writeLong(startTime);
+    Text.writeString(out, user);
     Text.writeString(out, schedulingInfo);
     out.writeLong(superstepCount);
   }
@@ -182,6 +182,7 @@ public class JobStatus implements Writab
     this.cleanupProgress = in.readFloat();
     this.runState = in.readInt();
     this.startTime = in.readLong();
+    this.user = Text.readString(in);
     this.schedulingInfo = Text.readString(in);
     this.superstepCount = in.readLong();
   }

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=1045056&r1=1045055&r2=1045056&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 Mon Dec 13 10:42:55
2010
@@ -92,12 +92,10 @@ class TaskInProgress {
   public Task getTaskToRun(GroomServerStatus status) throws IOException {
     Task t = null;
 
-    // TODO use the TaskID, instead of String.
     TaskAttemptID taskid = null;
     if (nextTaskId < (MAX_TASK_EXECS + maxTaskAttempts)) {
       int attemptId = job.getNumRestarts() * NUM_ATTEMPTS_PER_RESTART + nextTaskId;
       taskid = new TaskAttemptID( id, attemptId);
-      //new String("task_" + status.getGroomName() + "_" + nextTaskId);
       
       ++nextTaskId;
     } else {



Mime
View raw message