hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r669334 - in /hadoop/core/branches/branch-0.17: CHANGES.txt src/java/org/apache/hadoop/dfs/DFSck.java src/java/org/apache/hadoop/dfs/NamenodeFsck.java
Date Wed, 18 Jun 2008 23:41:27 GMT
Author: acmurthy
Date: Wed Jun 18 16:41:27 2008
New Revision: 669334

URL: http://svn.apache.org/viewvc?rev=669334&view=rev
Log:
Merge -r 650764:650765 -r 669327:669328 from trunk to branch-0.17 to fix HADOOP-1979

Modified:
    hadoop/core/branches/branch-0.17/CHANGES.txt
    hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/DFSck.java
    hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/NamenodeFsck.java

Modified: hadoop/core/branches/branch-0.17/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/CHANGES.txt?rev=669334&r1=669333&r2=669334&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.17/CHANGES.txt Wed Jun 18 16:41:27 2008
@@ -14,6 +14,11 @@
     HADOOP-3522. Improve documentation on reduce pointing out that
     input keys and values will be reused. (omalley)
 
+  BUG FIXES
+
+    HADOOP-1979. Speed up fsck by adding a buffered stream. (Lohit
+    Vijaya Renu via omalley)
+
 Release 0.17.0 - 2008-05-18
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/DFSck.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/DFSck.java?rev=669334&r1=669333&r2=669334&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/DFSck.java (original)
+++ hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/DFSck.java Wed Jun 18
16:41:27 2008
@@ -20,6 +20,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.io.BufferedReader;
 import java.net.URL;
 import java.net.URLConnection;
 import java.net.URLEncoder;
@@ -106,13 +107,12 @@
     URL path = new URL(url.toString());
     URLConnection connection = path.openConnection();
     InputStream stream = connection.getInputStream();
-    InputStreamReader input =
-      new InputStreamReader(stream, "UTF-8");
+    BufferedReader input = new BufferedReader(new InputStreamReader(
+                                              stream, "UTF-8"));
+    String line = null;
     try {
-      int c = input.read();
-      while (c != -1) {
-        System.out.print((char) c);
-        c = input.read();
+      while ((line = input.readLine()) != null) {
+        System.out.println(line);
       }
     } finally {
       input.close();

Modified: hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/NamenodeFsck.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/NamenodeFsck.java?rev=669334&r1=669333&r2=669334&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/NamenodeFsck.java (original)
+++ hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/NamenodeFsck.java Wed
Jun 18 16:41:27 2008
@@ -167,9 +167,8 @@
           blocks.locatedBlockCount() + " block(s): ");
     }  else {
       out.print('.');
-      out.flush();
-      if (res.totalFiles % 100 == 0) { out.println(); }
     }
+    if (res.totalFiles % 100 == 0) { out.flush(); }
     int missing = 0;
     long missize = 0;
     int underReplicatedPerFile = 0;
@@ -242,7 +241,7 @@
     }
     if (missing > 0) {
       if (!showFiles) {
-        out.println("\n" + path + ": MISSING " + missing
+        out.print("\n" + path + ": MISSING " + missing
             + " blocks of total size " + missize + " B.");
       }
       res.corruptFiles++;
@@ -258,12 +257,12 @@
     }
     if (showFiles) {
       if (missing > 0) {
-        out.println(" MISSING " + missing + " blocks of total size " + missize + " B");
+        out.print(" MISSING " + missing + " blocks of total size " + missize + " B\n");
       }  else if (underReplicatedPerFile == 0 && misReplicatedPerFile == 0) {
-        out.println(" OK");
+        out.print(" OK\n");
       }
       if (showBlocks) {
-        out.println(report.toString());
+        out.print(report.toString() + "\n");
       }
     }
   }



Mime
View raw message