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/06/30 19:20:57 UTC

hbase git commit: HBASE-14001 Optimize write(OutputStream out, boolean withTags) for SizeCachedNoTagsKeyValue.

Repository: hbase
Updated Branches:
  refs/heads/master f8bd578b8 -> 7e7fbdb84


HBASE-14001 Optimize write(OutputStream out, boolean withTags) for SizeCachedNoTagsKeyValue.


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

Branch: refs/heads/master
Commit: 7e7fbdb84b6173a26169ae995bf55c536f77d9c8
Parents: f8bd578
Author: anoopsjohn <an...@gmail.com>
Authored: Tue Jun 30 22:50:38 2015 +0530
Committer: anoopsjohn <an...@gmail.com>
Committed: Tue Jun 30 22:50:38 2015 +0530

----------------------------------------------------------------------
 .../apache/hadoop/hbase/SizeCachedNoTagsKeyValue.java    | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/7e7fbdb8/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedNoTagsKeyValue.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedNoTagsKeyValue.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedNoTagsKeyValue.java
index 23ed0c6..619196d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedNoTagsKeyValue.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedNoTagsKeyValue.java
@@ -19,7 +19,11 @@
  */
 package org.apache.hadoop.hbase;
 
+import java.io.IOException;
+import java.io.OutputStream;
+
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
+import org.apache.hadoop.hbase.util.Bytes;
 
 /**
  * This class is an extension to ContentSizeCachedKeyValue where there are no tags in Cell.
@@ -42,4 +46,11 @@ public class SizeCachedNoTagsKeyValue extends SizeCachedKeyValue {
   public long heapSizeWithoutTags() {
     return super.heapSize();
   }
+
+  @Override
+  public int write(OutputStream out, boolean withTags) throws IOException {
+    writeInt(out, this.length);
+    out.write(this.bytes, this.offset, this.length);
+    return this.length + Bytes.SIZEOF_INT;
+  }
 }