hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r908321 - in /hadoop/mapreduce/trunk: CHANGES.txt src/test/mapred/org/apache/hadoop/cli/testMRConf.xml src/tools/org/apache/hadoop/tools/HadoopArchives.java
Date Wed, 10 Feb 2010 02:19:42 GMT
Author: mahadev
Date: Wed Feb 10 02:19:41 2010
New Revision: 908321

URL: http://svn.apache.org/viewvc?rev=908321&view=rev
Log:
MAPREDUCE-1399. The archive command shows a null error message (nicholas via mahadev)

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/cli/testMRConf.xml
    hadoop/mapreduce/trunk/src/tools/org/apache/hadoop/tools/HadoopArchives.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=908321&r1=908320&r2=908321&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Wed Feb 10 02:19:41 2010
@@ -316,6 +316,9 @@
     appropriate UGIs while getting the TaskUmbilicalProtocol proxy and 
     while executing the task. (Jakob Homan via ddas)
 
+    MAPREDUCE-1399. The archive command shows a null error message (nicholas
+    via mahadev)
+
 Release 0.21.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/cli/testMRConf.xml
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/cli/testMRConf.xml?rev=908321&r1=908320&r2=908321&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/cli/testMRConf.xml (original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/cli/testMRConf.xml Wed Feb 10
02:19:41 2010
@@ -93,6 +93,23 @@
     </test>
 
     <test> <!-- TESTED -->
+      <description>Archive: Archive does not show null message</description>
+      <test-commands>
+        <command>-fs NAMENODE -mkdir bar</command>
+        <archive-command>-fs NAMENODE -archiveName foo.har -p . foo .</archive-command>
+      </test-commands>
+      <cleanup-commands>
+        <command>-fs NAMENODE -rmr /\*</command>
+      </cleanup-commands>
+      <comparators>
+        <comparator>
+          <type>SubstringComparator</type>
+          <expected-output>Index: 0, Size: 0</expected-output>
+        </comparator>
+      </comparators>
+    </test>
+
+    <test> <!-- TESTED -->
       <description>Archive: source and destination are same</description>
       <test-commands>
         <command>-fs NAMENODE -mkdir /dir0</command>
@@ -389,8 +406,8 @@
       </cleanup-commands>
       <comparators>
         <comparator>
-          <type>TokenComparator</type>
-          <expected-output>java.lang.NullPointerException</expected-output>
+          <type>SubstringComparator</type>
+          <expected-output>Index: 0, Size: 0</expected-output>
          </comparator>
        </comparators>
     </test>

Modified: hadoop/mapreduce/trunk/src/tools/org/apache/hadoop/tools/HadoopArchives.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/tools/org/apache/hadoop/tools/HadoopArchives.java?rev=908321&r1=908320&r2=908321&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/tools/org/apache/hadoop/tools/HadoopArchives.java (original)
+++ hadoop/mapreduce/trunk/src/tools/org/apache/hadoop/tools/HadoopArchives.java Wed Feb 10
02:19:41 2010
@@ -794,8 +794,10 @@
       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);
@@ -816,8 +818,13 @@
       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);



Mime
View raw message