You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by an...@apache.org on 2015/08/06 06:47:27 UTC
hbase git commit: HBASE-14186 Read mvcc vlong optimization.
Repository: hbase
Updated Branches:
refs/heads/master 18c9bb8b5 -> 5d2708f62
HBASE-14186 Read mvcc vlong optimization.
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5d2708f6
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5d2708f6
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5d2708f6
Branch: refs/heads/master
Commit: 5d2708f628d4718f6267e9da6c8cbafeda66f4fb
Parents: 18c9bb8
Author: anoopsjohn <an...@gmail.com>
Authored: Thu Aug 6 10:16:51 2015 +0530
Committer: anoopsjohn <an...@gmail.com>
Committed: Thu Aug 6 10:16:51 2015 +0530
----------------------------------------------------------------------
.../hadoop/hbase/io/hfile/HFileReaderImpl.java | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/5d2708f6/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
index 82f5366..18240b1 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
@@ -633,9 +633,22 @@ public class HFileReaderImpl implements HFile.Reader, Configurable {
if (len == 1) {
this.currMemstoreTS = firstByte;
} else {
+ int remaining = len -1;
long i = 0;
offsetFromPos++;
- for (int idx = 0; idx < len - 1; idx++) {
+ if (remaining >= Bytes.SIZEOF_INT) {
+ i = blockBuffer.getIntAfterPosition(offsetFromPos);
+ remaining -= Bytes.SIZEOF_INT;
+ offsetFromPos += Bytes.SIZEOF_INT;
+ }
+ if (remaining >= Bytes.SIZEOF_SHORT) {
+ short s = blockBuffer.getShortAfterPosition(offsetFromPos);
+ i = i << 16;
+ i = i | (s & 0xFFFF);
+ remaining -= Bytes.SIZEOF_SHORT;
+ offsetFromPos += Bytes.SIZEOF_SHORT;
+ }
+ for (int idx = 0; idx < remaining; idx++) {
byte b = blockBuffer.getByteAfterPosition(offsetFromPos + idx);
i = i << 8;
i = i | (b & 0xFF);