HBASE-14186 Read mvcc vlong optimization.
This commit is contained in:
parent
18c9bb8b54
commit
5d2708f628
|
@ -633,9 +633,22 @@ public class HFileReaderImpl implements HFile.Reader, Configurable {
|
||||||
if (len == 1) {
|
if (len == 1) {
|
||||||
this.currMemstoreTS = firstByte;
|
this.currMemstoreTS = firstByte;
|
||||||
} else {
|
} else {
|
||||||
|
int remaining = len -1;
|
||||||
long i = 0;
|
long i = 0;
|
||||||
offsetFromPos++;
|
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);
|
byte b = blockBuffer.getByteAfterPosition(offsetFromPos + idx);
|
||||||
i = i << 8;
|
i = i << 8;
|
||||||
i = i | (b & 0xFF);
|
i = i | (b & 0xFF);
|
||||||
|
|
Loading…
Reference in New Issue