Jelajahi Sumber

HADOOP-1977. Fixed handling of ToolBase cli options in JobClient. (enis via
omalley)


git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@581319 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 18 tahun lalu
induk
melakukan
08bca82705

+ 5 - 3
CHANGES.txt

@@ -214,9 +214,6 @@ Trunk (unreleased changes)
     HADOOP-1930.  Fix the blame for failed fetchs on the right host. (Arun C.
     Murthy via omalley)
 
-    HADOOP-1862.  reduces are getting stuck trying to find map outputs. 
-    (Arun C. Murthy via ddas)
-
   IMPROVEMENTS
 
     HADOOP-1908. Restructure data node code so that block sending and 
@@ -326,12 +323,17 @@ Trunk (unreleased changes)
 
 Release 0.14.2 - unreleased
 
+  BUG FIXES
+
     HADOOP-1948. Removed spurious error message during block crc upgrade.
     (Raghu Angadi via dhruba)
 
     HADOOP-1862.  reduces are getting stuck trying to find map outputs. 
     (Arun C. Murthy via ddas)
 
+    HADOOP-1977. Fixed handling of ToolBase cli options in JobClient.
+    (enis via omalley)
+
 Release 0.14.1 - 2007-09-04
 
   BUG FIXES

+ 1 - 1
src/java/org/apache/hadoop/mapred/JobClient.java

@@ -862,7 +862,7 @@ public class JobClient extends Configured implements MRConstants, Tool  {
     if (submitJobFile != null) {
       conf = new JobConf(submitJobFile);
     } else {
-      conf = new JobConf();
+      conf = new JobConf(getConf());
     }
     init(conf);
         

+ 5 - 3
src/java/org/apache/hadoop/mapred/JobSubmissionProtocol.java

@@ -18,7 +18,7 @@
 
 package org.apache.hadoop.mapred;
 
-import java.io.*;
+import java.io.IOException;
 
 import org.apache.hadoop.ipc.VersionedProtocol;
 
@@ -70,12 +70,14 @@ public interface JobSubmissionProtocol extends VersionedProtocol {
   public boolean killTask(String taskId, boolean shouldFail) throws IOException;
   
   /**
-   * Grab a handle to a job that is already known to the JobTracker
+   * Grab a handle to a job that is already known to the JobTracker.
+   * @return Profile of the job, or null if not found. 
    */
   public JobProfile getJobProfile(String jobid) throws IOException;
 
   /**
-   * Grab a handle to a job that is already known to the JobTracker
+   * Grab a handle to a job that is already known to the JobTracker.
+   * @return Status of the job, or null if not found.
    */
   public JobStatus getJobStatus(String jobid) throws IOException;
 

+ 11 - 3
src/java/org/apache/hadoop/mapred/LocalJobRunner.java

@@ -28,7 +28,8 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.io.*;
+import org.apache.hadoop.io.BytesWritable;
+import org.apache.hadoop.io.DataOutputBuffer;
 import org.apache.hadoop.mapred.JobTracker.JobTrackerMetrics;
 
 /** Implements MapReduce locally, in-process, for debugging. */ 
@@ -97,6 +98,7 @@ class LocalJobRunner implements JobSubmissionProtocol {
       return profile;
     }
     
+    @Override
     public void run() {
       try {
         // split input into minimum number of splits
@@ -291,7 +293,10 @@ class LocalJobRunner implements JobSubmissionProtocol {
 
   public JobProfile getJobProfile(String id) {
     Job job = jobs.get(id);
-    return job.getProfile();
+    if(job != null)
+      return job.getProfile();
+    else 
+      return null;
   }
 
   public TaskReport[] getMapTaskReports(String id) {
@@ -303,7 +308,10 @@ class LocalJobRunner implements JobSubmissionProtocol {
 
   public JobStatus getJobStatus(String id) {
     Job job = jobs.get(id);
-    return job.status;
+    if(job != null)
+      return job.status;
+    else 
+      return null;
   }
   
   public Counters getJobCounters(String id) {