hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1354658 - in /hadoop/common/branches/branch-2/hadoop-mapreduce-project: ./ hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/ hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/or...
Date Wed, 27 Jun 2012 18:33:40 GMT
Author: tucu
Date: Wed Jun 27 18:33:38 2012
New Revision: 1354658

URL: http://svn.apache.org/viewvc?rev=1354658&view=rev
Log:
Reverting MAPREDUCE-4346

Added:
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestJobClientGetJob.java
      - copied unchanged from r1354656, hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestJobClientGetJob.java
Removed:
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestJobClient.java
Modified:
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java

Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt?rev=1354658&r1=1354657&r2=1354658&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt Wed Jun 27 18:33:38
2012
@@ -6,8 +6,6 @@ Release 2.0.1-alpha - UNRELEASED
 
   NEW FEATURES
 
-    MAPREDUCE-4355. Add JobStatus getJobStatus(JobID) to JobClient. (kkambatl via tucu)
-
   IMPROVEMENTS
 
     MAPREDUCE-4146. Support limits on task status string length and number of

Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java?rev=1354658&r1=1354657&r2=1354658&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java
Wed Jun 27 18:33:38 2012
@@ -620,15 +620,6 @@ public class JobClient extends CLI {
     }
   }
 
-  private JobStatus getJobStatusUsingCluster(final JobID jobId)
-      throws IOException, InterruptedException {
-    return clientUgi.doAs(new PrivilegedExceptionAction<JobStatus>() {
-      public JobStatus run() throws IOException, InterruptedException {
-        return JobStatus.downgrade(cluster.getJobStatus(jobId));
-      }
-    });
-  }
-
   private Job getJobUsingCluster(final JobID jobid) throws IOException,
   InterruptedException {
     return clientUgi.doAs(new PrivilegedExceptionAction<Job>() {
@@ -637,40 +628,28 @@ public class JobClient extends CLI {
       }
     });
   }
-
   /**
-   * Get {@link JobStatus} of a job. Returns null if the id does not correspond
-   * to any known job.
+   * Get an {@link RunningJob} object to track an ongoing job.  Returns
+   * null if the id does not correspond to any known job.
    * 
-   * @param jobid
-   *          the jobid of the job.
-   * @return the {@link JobStatus} object to retrieve the job stats, null if the
+   * @param jobid the jobid of the job.
+   * @return the {@link RunningJob} handle to track the job, null if the 
    *         <code>jobid</code> doesn't correspond to any known job.
    * @throws IOException
    */
-  public JobStatus getJobStatus(JobID jobId) throws IOException {
+  public RunningJob getJob(final JobID jobid) throws IOException {
     try {
-      return getJobStatusUsingCluster(jobId);
+      
+      Job job = getJobUsingCluster(jobid);
+      if (job != null) {
+        JobStatus status = JobStatus.downgrade(job.getStatus());
+        if (status != null) {
+          return new NetworkedJob(status, cluster);
+        } 
+      }
     } catch (InterruptedException ie) {
       throw new IOException(ie);
     }
-  }
-
-  /**
-   * Get an {@link RunningJob} object to track an ongoing job. Returns null if
-   * the id does not correspond to any known job.
-   * 
-   * @param jobid
-   *          the jobid of the job.
-   * @return the {@link RunningJob} handle to track the job, null if the
-   *         <code>jobid</code> doesn't correspond to any known job.
-   * @throws IOException
-   */
-  public RunningJob getJob(JobID jobId) throws IOException {
-    JobStatus status = getJobStatus(jobId);
-    if (status != null) {
-      return new NetworkedJob(status, cluster);
-    }
     return null;
   }
 

Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java?rev=1354658&r1=1354657&r2=1354658&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java
Wed Jun 27 18:33:38 2012
@@ -173,19 +173,6 @@ public class Cluster {
   }
 
   /**
-   * Get JobStatus corresponding to jobId.
-   * 
-   * @param jobId
-   * @return object of {@link JobStatus}
-   * @throws IOException
-   * @throws InterruptedException
-   */
-  public JobStatus getJobStatus(JobID jobId) throws IOException,
-      InterruptedException {
-    return client.getJobStatus(jobId);
-  }
-
-  /**
    * Get job corresponding to jobid.
    * 
    * @param jobId
@@ -194,7 +181,7 @@ public class Cluster {
    * @throws InterruptedException
    */
   public Job getJob(JobID jobId) throws IOException, InterruptedException {
-    JobStatus status = getJobStatus(jobId);
+    JobStatus status = client.getJobStatus(jobId);
     if (status != null) {
       return Job.getInstance(this, status, new JobConf(status.getJobFile()));
     }



Mime
View raw message