You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cu...@apache.org on 2006/10/24 23:34:07 UTC

svn commit: r467494 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/DFSShell.java

Author: cutting
Date: Tue Oct 24 14:34:06 2006
New Revision: 467494

URL: http://svn.apache.org/viewvc?view=rev&rev=467494
Log:
HADOOP-554.  Fix DFSShell to return -1 for errors.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=467494&r1=467493&r2=467494
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Tue Oct 24 14:34:06 2006
@@ -37,6 +37,9 @@
 10. HADOOP-625.  Add a servlet to all http daemons that displays a
     stack dump, useful for debugging.  (omalley via cutting)
 
+11. HADOOP-554.  Fix DFSShell to return -1 for errors.
+    (Dhruba Borthakur via cutting) 
+
 
 Release 0.7.2 - 2006-10-18
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java?view=diff&rev=467494&r1=467493&r2=467494
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java Tue Oct 24 14:34:06 2006
@@ -264,7 +264,7 @@
     private void ls(Path src, boolean recursive, boolean printHeader ) throws IOException {
         Path items[] = fs.listPaths(src);
         if (items == null) {
-            System.out.println("Could not get listing for " + src);
+            throw new IOException("Could not get listing for " + src);
         } else {
             if(!recursive && printHeader ) {
             	System.out.println("Found " + items.length + " items");
@@ -292,7 +292,7 @@
     public void du(String src) throws IOException {
         Path items[] = fs.listPaths( fs.globPaths( new Path(src) ) );
         if (items == null) {
-            System.out.println("Could not get listing for " + src);
+            throw new IOException("Could not get listing for " + src);
         } else {
             System.out.println("Found " + items.length + " items");
             for (int i = 0; i < items.length; i++) {
@@ -591,6 +591,10 @@
         // initialize DFSShell
         try {
             init();
+        } catch (RPC.VersionMismatch v) { 
+            System.err.println("Version Mismatch between client and server" +
+                               "... command aborted.");
+            return exitCode;
         } catch (IOException e) {
             System.err.println("Bad connection to DFS... command aborted.");
             return exitCode;