1
0
Selaa lähdekoodia

commit 5ef04fe9348b44aa5511a04f92a951c698d64911
Author: Mahadev Konar <mahadev@cdev6022.inktomisearch.com>
Date: Thu Feb 11 19:35:40 2010 +0000

MAPREDUCE:1399 from http://issues.apache.org/jira/secure/attachment/12435380/m1399_20100205trunk2_y0.20.patch

+++ b/YAHOO-CHANGES.txt
+ MAPREDUCE-1399. The archive command shows a null error message. (nicholas)
+


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

Owen O'Malley 14 vuotta sitten
vanhempi
commit
f0972fe437
1 muutettua tiedostoa jossa 11 lisäystä ja 4 poistoa
  1. 11 4
      src/tools/org/apache/hadoop/tools/HadoopArchives.java

+ 11 - 4
src/tools/org/apache/hadoop/tools/HadoopArchives.java

@@ -742,8 +742,10 @@ public class HadoopArchives implements Tool {
       for (Path p: srcPaths) {
         FileSystem fs = p.getFileSystem(getConf());
         FileStatus[] statuses = fs.globStatus(p);
-        for (FileStatus status: statuses) {
-          globPaths.add(fs.makeQualified(status.getPath()));
+        if (statuses != null) {
+          for (FileStatus status: statuses) {
+            globPaths.add(fs.makeQualified(status.getPath()));
+          }
         }
       }
       archive(parentPath, globPaths, archiveName, destPath);
@@ -764,8 +766,13 @@ public class HadoopArchives implements Tool {
       ret = ToolRunner.run(harchives, args);
     } catch(Exception e) {
       LOG.debug("Exception in archives  ", e);
-      System.err.println("Exception in archives");
-      System.err.println(e.getLocalizedMessage());
+      System.err.println(e.getClass().getSimpleName() + " in archives");
+      final String s = e.getLocalizedMessage();
+      if (s != null) {
+        System.err.println(s);
+      } else {
+        e.printStackTrace(System.err);
+      }
       System.exit(1);
     }
     System.exit(ret);