You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by nd...@apache.org on 2022/05/18 10:59:46 UTC
[hbase] branch revert-4394-HBASE-26856 created (now 2ba95322c66)
This is an automated email from the ASF dual-hosted git repository.
ndimiduk pushed a change to branch revert-4394-HBASE-26856
in repository https://gitbox.apache.org/repos/asf/hbase.git
at 2ba95322c66 Revert "HBASE-26856:BufferedDataBlockEncoder.OnheapDecodedCell value can get corrupted (#4394)"
This branch includes the following new commits:
new 2ba95322c66 Revert "HBASE-26856:BufferedDataBlockEncoder.OnheapDecodedCell value can get corrupted (#4394)"
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[hbase] 01/01: Revert "HBASE-26856:BufferedDataBlockEncoder.OnheapDecodedCell value can get corrupted (#4394)"
Posted by nd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ndimiduk pushed a commit to branch revert-4394-HBASE-26856
in repository https://gitbox.apache.org/repos/asf/hbase.git
commit 2ba95322c66bbe4135fb72827a4ca572dfd1856a
Author: Nick Dimiduk <nd...@gmail.com>
AuthorDate: Wed May 18 12:59:37 2022 +0200
Revert "HBASE-26856:BufferedDataBlockEncoder.OnheapDecodedCell value can get corrupted (#4394)"
This reverts commit c198f23e5eb078abc47d4c3439477c6c2b4d5136.
---
.../io/encoding/BufferedDataBlockEncoder.java | 23 +++++-----------------
1 file changed, 5 insertions(+), 18 deletions(-)
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java
index 93960f7a314..8ab17285d9d 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java
@@ -232,10 +232,9 @@ abstract class BufferedDataBlockEncoder extends AbstractDataBlockEncoder {
int tOffset = 0;
if (this.includeTags) {
if (this.tagCompressionContext == null) {
+ tagsArray = valAndTagsBuffer.array();
tOffset =
valAndTagsBuffer.arrayOffset() + vOffset + this.valueLength + tagsLenSerializationSize;
- tagsArray = Bytes.copy(valAndTagsBuffer.array(), tOffset, this.tagsLength);
- tOffset = 0;
} else {
tagsArray = Bytes.copy(tagsBuffer, 0, this.tagsLength);
tOffset = 0;
@@ -244,8 +243,9 @@ abstract class BufferedDataBlockEncoder extends AbstractDataBlockEncoder {
return new OnheapDecodedCell(Bytes.copy(keyBuffer, 0, this.keyLength),
currentKey.getRowLength(), currentKey.getFamilyOffset(), currentKey.getFamilyLength(),
currentKey.getQualifierOffset(), currentKey.getQualifierLength(), currentKey.getTimestamp(),
- currentKey.getTypeByte(), Bytes.copy(valAndTagsBuffer.array(), valAndTagsBuffer.arrayOffset() + vOffset,
- this.valueLength), 0, this.valueLength, memstoreTS, tagsArray, tOffset, this.tagsLength);
+ currentKey.getTypeByte(), valAndTagsBuffer.array(),
+ valAndTagsBuffer.arrayOffset() + vOffset, this.valueLength, memstoreTS, tagsArray, tOffset,
+ this.tagsLength);
}
private Cell toOffheapCell(ByteBuffer valAndTagsBuffer, int vOffset,
@@ -254,26 +254,13 @@ abstract class BufferedDataBlockEncoder extends AbstractDataBlockEncoder {
int tOffset = 0;
if (this.includeTags) {
if (this.tagCompressionContext == null) {
+ tagsBuf = valAndTagsBuffer;
tOffset = vOffset + this.valueLength + tagsLenSerializationSize;
- byte[] output = new byte[this.tagsLength];
- ByteBufferUtils.copyFromBufferToArray(output, valAndTagsBuffer, tOffset, 0,
- this.tagsLength);
- tagsBuf = ByteBuffer.wrap(output);
- tOffset = 0;
} else {
tagsBuf = ByteBuffer.wrap(Bytes.copy(tagsBuffer, 0, this.tagsLength));
tOffset = 0;
}
}
-
- if (this.valueLength > 0) {
- byte[] output = new byte[this.valueLength];
- ByteBufferUtils.copyFromBufferToArray(output, valAndTagsBuffer, vOffset, 0,
- this.valueLength);
- valAndTagsBuffer = ByteBuffer.wrap(output);
- vOffset = 0;
- }
-
return new OffheapDecodedExtendedCell(
ByteBuffer.wrap(Bytes.copy(keyBuffer, 0, this.keyLength)), currentKey.getRowLength(),
currentKey.getFamilyOffset(), currentKey.getFamilyLength(), currentKey.getQualifierOffset(),