diff --git a/build.xml b/build.xml index dc74046..35ff5f4 100644 --- a/build.xml +++ b/build.xml @@ -18,7 +18,7 @@ --> - + diff --git a/src/java/org/apache/hadoop/hbase/io/hfile/BoundedRangeFileInputStream.java b/src/java/org/apache/hadoop/hbase/io/hfile/BoundedRangeFileInputStream.java index f7da04d..6c71c5b 100644 --- a/src/java/org/apache/hadoop/hbase/io/hfile/BoundedRangeFileInputStream.java +++ b/src/java/org/apache/hadoop/hbase/io/hfile/BoundedRangeFileInputStream.java @@ -63,7 +63,7 @@ class BoundedRangeFileInputStream extends InputStream { this.pos = offset; this.end = offset + length; this.mark = -1; - this.pread = pread; + this.pread = false; // TURN OFF PREAD pread; } @Override diff --git a/src/java/org/apache/hadoop/hbase/io/hfile/HFile.java b/src/java/org/apache/hadoop/hbase/io/hfile/HFile.java index a0ee56f..6a61678 100644 --- a/src/java/org/apache/hadoop/hbase/io/hfile/HFile.java +++ b/src/java/org/apache/hadoop/hbase/io/hfile/HFile.java @@ -19,6 +19,7 @@ */ package org.apache.hadoop.hbase.io.hfile; +import java.io.BufferedInputStream; import java.io.Closeable; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -1011,9 +1012,11 @@ public class HFile { // bunch of data w/o regard to whether decompressor is coming to end of a // decompression. InputStream is = this.compressAlgo.createDecompressionStream( - new BoundedRangeFileInputStream(this.istream, offset, compressedSize, - pread), - decompressor, 0); + new BufferedInputStream( + new BoundedRangeFileInputStream(this.istream, offset, compressedSize, + pread), + Math.min(65536, compressedSize)), + decompressor, 0); buf = ByteBuffer.allocate(decompressedSize); IOUtils.readFully(is, buf.array(), 0, buf.capacity()); is.close();