hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject hbase git commit: HBASE-16792 Reuse KeyValue.KeyOnlyKeyValue in BufferedDataBlockEncoder.SeekerState (Binlijin)
Date Thu, 13 Oct 2016 04:42:03 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 92ef23448 -> f11aa4542


HBASE-16792 Reuse KeyValue.KeyOnlyKeyValue in
BufferedDataBlockEncoder.SeekerState (Binlijin)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f11aa454
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f11aa454
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f11aa454

Branch: refs/heads/master
Commit: f11aa4542f8f5489823fb72d1e9bc98e5cc6d742
Parents: 92ef234
Author: Ramkrishna <ramkrishna.s.vasudevan@intel.com>
Authored: Thu Oct 13 10:11:27 2016 +0530
Committer: Ramkrishna <ramkrishna.s.vasudevan@intel.com>
Committed: Thu Oct 13 10:11:27 2016 +0530

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/KeyValue.java      | 8 ++++++++
 .../hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java   | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f11aa454/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java
index 8f8554c..da5677d 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java
@@ -43,6 +43,7 @@ import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.ClassSize;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.io.RawComparator;
+
 import com.google.common.annotations.VisibleForTesting;
 
 /**
@@ -2641,6 +2642,13 @@ public class KeyValue implements ExtendedCell {
       this.rowLen = Bytes.toShort(this.bytes, this.offset);
     }
 
+    public void clear() {
+      rowLen = -1;
+      bytes = null;
+      offset = 0;
+      length = 0;
+    }
+
     @Override
     public int getKeyOffset() {
       return this.offset;

http://git-wip-us.apache.org/repos/asf/hbase/blob/f11aa454/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java
----------------------------------------------------------------------
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 4d3a26c..514e829 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
@@ -139,7 +139,7 @@ abstract class BufferedDataBlockEncoder extends AbstractDataBlockEncoder
{
     protected void invalidate() {
       valueOffset = -1;
       tagsCompressedLength = 0;
-      currentKey = new KeyValue.KeyOnlyKeyValue();
+      currentKey.clear();
       uncompressTags = true;
       currentBuffer = null;
     }


Mime
View raw message