hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r483598 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/DFSShell.java
Date Thu, 07 Dec 2006 18:36:10 GMT
Author: cutting
Date: Thu Dec  7 10:36:09 2006
New Revision: 483598

URL: http://svn.apache.org/viewvc?view=rev&rev=483598
Log:
HADOOP-621.  Change 'dfs -cat' to exit sooner when output has been closed.  Contributed by
Dhruba.

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=483598&r1=483597&r2=483598
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Thu Dec  7 10:36:09 2006
@@ -14,6 +14,9 @@
  4. HADOOP-777. Use fully-qualified hostnames for tasktrackers and
     datanodes.  (Mahadev Konar via cutting)
 
+ 5. HADOOP-621. Change 'dfs -cat' to exit sooner when output has been
+    closed.  (Dhruba Borthakur via cutting) 
+
 
 Release 0.9.0 - 2006-12-01
 

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=483598&r1=483597&r2=483598
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java Thu Dec  7 10:36:09 2006
@@ -148,8 +148,21 @@
       try {
         BufferedReader din = new BufferedReader(new InputStreamReader(in));
         String line;
+        int checkFactor = 0;
         while((line = din.readLine()) != null) {
           System.out.println(line);      
+
+          //
+          // Peridically check if the output encountered an error. This can
+          // happen if the output stream has been disconnected
+          //
+          if (checkFactor == 0) {
+            if (System.out.checkError()) {
+              throw new IOException("Unable to write to output stream");
+            }
+            checkFactor = 10000;
+          }
+          checkFactor--;
         }
       } finally {
         in.close();



Mime
View raw message