Ver Fonte

HADOOP-2212. ChecksumFileSystem.getSumBufferSize might throw java.lang.ArithmeticException. The fix is to initialize bytesPerChecksum to 0. Contributed by Michael Bieniosek

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@597133 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das há 18 anos atrás
pai
commit
6e03553e19
2 ficheiros alterados com 5 adições e 1 exclusões
  1. 4 0
      CHANGES.txt
  2. 1 1
      src/java/org/apache/hadoop/fs/ChecksumFileSystem.java

+ 4 - 0
CHANGES.txt

@@ -122,6 +122,10 @@ Trunk (unreleased changes)
     completed by another (possibly speculative) map-task. This ensures that 
     map-slots are not needlessly held-up. (acmurthy)
 
+    HADOOP-2212. ChecksumFileSystem.getSumBufferSize might throw 
+    java.lang.ArithmeticException. The fix is to initialize bytesPerChecksum
+    to 0.  (Michael Bieniosek via ddas)
+
 
 Release 0.15.1 - 2007-11-27
 

+ 1 - 1
src/java/org/apache/hadoop/fs/ChecksumFileSystem.java

@@ -37,7 +37,7 @@ import org.apache.hadoop.util.StringUtils;
  *****************************************************************/
 public abstract class ChecksumFileSystem extends FilterFileSystem {
   private static final byte[] CHECKSUM_VERSION = new byte[] {'c', 'r', 'c', 0};
-  private int bytesPerChecksum;
+  private int bytesPerChecksum = 512;
 
   public static double getApproxChkSumLength(long size) {
     return ChecksumFSOutputSummer.CHKSUM_AS_FRACTION * size;