hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r789237 - in /hadoop/mapreduce/trunk: CHANGES.txt src/tools/org/apache/hadoop/tools/DistCp.java
Date Mon, 29 Jun 2009 07:03:55 GMT
Author: cdouglas
Date: Mon Jun 29 07:03:55 2009
New Revision: 789237

URL: http://svn.apache.org/viewvc?rev=789237&view=rev
Log:
MAPREDUCE-658. Replace NPE in distcp with a meaningful error message when
the source path does not exist. Contributed by Ravi Gummadi

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/tools/org/apache/hadoop/tools/DistCp.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=789237&r1=789236&r2=789237&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Mon Jun 29 07:03:55 2009
@@ -55,3 +55,6 @@
     (Amar Kamat via sharad)
 
     MAPREDUCE-179. Update progress in new RecordReaders. (cdouglas)
+
+    MAPREDUCE-658. Replace NPE in distcp with a meaningful error message when
+    the source path does not exist. (Ravi Gummadi via cdouglas)

Modified: hadoop/mapreduce/trunk/src/tools/org/apache/hadoop/tools/DistCp.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/tools/org/apache/hadoop/tools/DistCp.java?rev=789237&r1=789236&r2=789237&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/tools/org/apache/hadoop/tools/DistCp.java (original)
+++ hadoop/mapreduce/trunk/src/tools/org/apache/hadoop/tools/DistCp.java Mon Jun 29 07:03:55
2009
@@ -545,6 +545,14 @@
                           StringUtils.stringifyException(e);
         out.collect(null, new Text(sfailure));
         LOG.info(sfailure);
+        if (e instanceof FileNotFoundException) {
+          final String s = "Possible Cause for failure: Either the filesystem "
+                           + srcstat.getPath().getFileSystem(job)
+                           + " is not accessible or the file is deleted";
+          LOG.error(s);
+          out.collect(null, new Text(s));
+        }
+
         try {
           for (int i = 0; i < 3; ++i) {
             try {
@@ -623,7 +631,7 @@
       FileSystem fs = p.getFileSystem(conf);
       FileStatus[] inputs = fs.globStatus(p);
       
-      if(inputs.length > 0) {
+      if(inputs != null && inputs.length > 0) {
         for (FileStatus onePath: inputs) {
           unglobbed.add(onePath.getPath());
         }



Mime
View raw message