Browse Source

MAPREDUCE-1068. Merge revision 835237 from trunk.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20@835239 13f79535-47bb-0310-9956-ffa450edef68
Sharad Agarwal 15 năm trước cách đây
mục cha
commit
4e23b61e3b

+ 3 - 0
CHANGES.txt

@@ -60,6 +60,9 @@ Release 0.20.2 - Unreleased
     HDFS-761. Fix failure to process rename operation from edits log due to 
     quota verification. (suresh)
 
+    MAPREDUCE-1068. Fix streaming job to show proper message if file is 
+    is not present. (Amareshwari Sriramadasu via sharad)
+
 Release 0.20.1 - 2009-09-01
 
   INCOMPATIBLE CHANGES

+ 5 - 3
src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamJob.java

@@ -118,6 +118,8 @@ public class StreamJob implements Tool {
       return submitAndMonitorJob();
     }catch (IllegalArgumentException ex) {
       //ignore, since log will already be printed
+      // print the log in debug mode.
+      LOG.debug("Error in streaming job", ex);
       return 1;
     }
   }
@@ -342,13 +344,13 @@ public class StreamJob implements Tool {
     return OptionBuilder.withDescription(desc).create(name);
   }
   
-  private static void validate(final List<String> values) 
+  private void validate(final List<String> values) 
   throws IllegalArgumentException {
     for (String file : values) {
       File f = new File(file);  
       if (!f.canRead()) {
-        throw new IllegalArgumentException("File : " + f.getAbsolutePath() 
-                                           + " is not readable."); 
+        fail("File: " + f.getAbsolutePath() 
+          + " does not exist, or is not readable."); 
       }
     }
   }