浏览代码

commit 031b0fd4175db8c534f5a8a69ca89cd1b5febded
Author: Arun C Murthy <acmurthy@apache.org>
Date: Fri Dec 11 14:16:29 2009 +0530

MAPREDUCE-1068. Added a verbose error message when user specifies an incorrect -file parameter. Contributed by Amareshwari Sriramadasu.

From https://issues.apache.org/jira/secure/attachment/12423898/patch-1068-1.txt

+++ b/YAHOO-CHANGES.txt
+ MAPREDUCE-1068. Added a verbose error message when user specifies an
+ incorrect -file parameter. (Amareshwari Sriramadasu via acmurthy)
+


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077074 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 年之前
父节点
当前提交
29502dc30f
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamJob.java

+ 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."); 
       }
     }
   }