hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r517423 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/fs/ChecksumFileSystem.java
Date Mon, 12 Mar 2007 22:17:29 GMT
Author: tomwhite
Date: Mon Mar 12 15:17:26 2007
New Revision: 517423

URL: http://svn.apache.org/viewvc?view=rev&rev=517423
Log:
HADOOP-1108.  Checksummed file system should retry reading if a different replica is found
when handling ChecksumException. Contributed by Hairong Kuang.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=517423&r1=517422&r2=517423
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Mon Mar 12 15:17:26 2007
@@ -42,6 +42,10 @@
 12. HADOOP-1112.  Fix a race condition in Hadoop metrics.
     (David Bowen via tomwhite)
 
+13. HADOOP-1108.  Checksummed file system should retry reading if a
+    different replica is found when handling ChecksumException.
+    (Hairong Kuang via tomwhite)
+
 
 Release 0.12.0 - 2007-03-02
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java?view=diff&rev=517423&r1=517422&r2=517423
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java Mon Mar 12 15:17:26
2007
@@ -221,14 +221,14 @@
             datas.seek(oldPos);
             
             if (seekToNewSource(oldPos)) {
-              // Neither the data stream nor the checksum stream are being read
-              // from different sources, meaning we'll still get a checksum error 
-              // if we try to do the read again.  We throw an exception instead.
-              throw ce;
+                // Since at least one of the sources is different, 
+                // the read might succeed, so we'll retry.
+                retry = true;
             } else {
-              // Since at least one of the sources is different, 
-              // the read might succeed, so we'll retry.
-              retry = true;
+                // Neither the data stream nor the checksum stream are being read
+                // from different sources, meaning we'll still get a checksum error 
+                // if we try to do the read again.  We throw an exception instead.
+                throw ce;
             }
           }
         }
@@ -311,7 +311,7 @@
 
     @Override
       public boolean seekToNewSource(long targetPos) throws IOException {
-      return datas.seekToNewSource(targetPos) &&
+      return datas.seekToNewSource(targetPos) ||
         sums.seekToNewSource(targetPos/bytesPerSum);
     }
 
@@ -401,7 +401,9 @@
     
     public void close() throws IOException {
       writeSum();
-      sums.close();
+      if(sums != null) {
+        sums.close();
+      }
       super.close();
     }
     



Mime
View raw message