Author: tucu
Date: Wed Jun 27 18:29:42 2012
New Revision: 1354656

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

Added:
    
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestJobClientGetJob.java
      - copied unchanged from r1353756, 
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/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestJobClient.java
Modified:
    hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
    
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java
    
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java

Modified: hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt?rev=1354656&r1=1354655&r2=1354656&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt Wed Jun 27 
18:29:42 2012
@@ -129,8 +129,6 @@ Branch-2 ( Unreleased changes )
 
   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/trunk/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/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java?rev=1354656&r1=1354655&r2=1354656&view=diff
==============================================================================
--- 
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java
 (original)
+++ 
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java
 Wed Jun 27 18:29:42 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/trunk/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/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java?rev=1354656&r1=1354655&r2=1354656&view=diff
==============================================================================
--- 
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java
 (original)
+++ 
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Cluster.java
 Wed Jun 27 18:29:42 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()));
     }


Reply via email to