hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r515856 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/fs/ChecksumFileSystem.java
Date Wed, 07 Mar 2007 23:56:01 GMT
Author: cutting
Date: Wed Mar  7 15:56:00 2007
New Revision: 515856

URL: http://svn.apache.org/viewvc?view=rev&rev=515856
Log:
HADOOP-1082.  Fix a NullPointerException in ChecksumFileSystem.  Contributed by Hairong.

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=515856&r1=515855&r2=515856
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Mar  7 15:56:00 2007
@@ -24,6 +24,9 @@
  6. HADOOP-1083.  Fix so that when a cluster restarts with a missing
     datanode, its blocks are replicated.  (Hairong Kuang via cutting)
 
+ 7. HADOOP-1082.  Fix a NullPointerException in ChecksumFileSystem.
+    (Hairong Kuang via cutting)
+
 
 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=515856&r1=515855&r2=515856
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java Wed Mar  7 15:56:00
2007
@@ -135,11 +135,15 @@
       long checksumBoundary = desired/bytesPerSum*bytesPerSum;
       if(checksumBoundary != getPos()) {
         datas.seek(checksumBoundary);
-        sums.seek(HEADER_LENGTH + 4*(checksumBoundary/bytesPerSum));
+        if(sums != null) {
+          sums.seek(HEADER_LENGTH + 4*(checksumBoundary/bytesPerSum));
+        }
       }
       
-      sum.reset();
-      inSum = 0;
+      if(sums != null) {
+        sum.reset();
+        inSum = 0;
+      }
       
       // scan to desired position
       int delta = (int)(desired - checksumBoundary);



Mime
View raw message