You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2016/09/26 20:55:46 UTC

[1/3] hbase git commit: HBASE-16694 Reduce garbage for onDiskChecksum in HFileBlock (binlijin)

Repository: hbase
Updated Branches:
  refs/heads/0.98 1bdf05b1f -> 6903296a3
  refs/heads/branch-1 4566e4df5 -> 67a43c305
  refs/heads/master f06c0060a -> b9ec59ebb


HBASE-16694 Reduce garbage for onDiskChecksum in HFileBlock (binlijin)


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

Branch: refs/heads/0.98
Commit: 6903296a3c181958eda82d0e2cbe24aba986efda
Parents: 1bdf05b
Author: Andrew Purtell <ap...@apache.org>
Authored: Mon Sep 26 13:49:10 2016 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Mon Sep 26 13:55:26 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/6903296a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
index 46e2ba1..546e1c6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
@@ -773,7 +773,7 @@ public class HFileBlock implements Cacheable {
      * part of onDiskBytesWithHeader. If data is uncompressed, then this
      * variable stores the checksum data for this block.
      */
-    private byte[] onDiskChecksum;
+    private byte[] onDiskChecksum = HConstants.EMPTY_BYTE_ARRAY;
 
     /**
      * Valid in the READY state. Contains the header and the uncompressed (but
@@ -918,7 +918,9 @@ public class HFileBlock implements Cacheable {
           onDiskBytesWithHeader.length + numBytes,
           uncompressedBytesWithHeader.length, onDiskBytesWithHeader.length);
 
-      onDiskChecksum = new byte[numBytes];
+      if (onDiskChecksum.length != numBytes) {
+        onDiskChecksum = new byte[numBytes];
+      }
       ChecksumUtil.generateChecksums(
           onDiskBytesWithHeader, 0, onDiskBytesWithHeader.length,
           onDiskChecksum, 0, fileContext.getChecksumType(), fileContext.getBytesPerChecksum());


[3/3] hbase git commit: HBASE-16694 Reduce garbage for onDiskChecksum in HFileBlock (binlijin)

Posted by ap...@apache.org.
HBASE-16694 Reduce garbage for onDiskChecksum in HFileBlock (binlijin)


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

Branch: refs/heads/master
Commit: b9ec59ebbe0ea392bfe742a9f3774d9447722d42
Parents: f06c006
Author: Andrew Purtell <ap...@apache.org>
Authored: Mon Sep 26 13:49:10 2016 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Mon Sep 26 13:55:35 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java    | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b9ec59eb/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
index 14a5cd1..1535fa9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
@@ -35,10 +35,10 @@ import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.fs.HFileSystem;
-import org.apache.hadoop.hbase.io.FSDataInputStreamWrapper;
 import org.apache.hadoop.hbase.io.ByteArrayOutputStream;
 import org.apache.hadoop.hbase.io.ByteBuffInputStream;
 import org.apache.hadoop.hbase.io.ByteBufferSupportDataOutputStream;
+import org.apache.hadoop.hbase.io.FSDataInputStreamWrapper;
 import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
 import org.apache.hadoop.hbase.io.encoding.HFileBlockDecodingContext;
 import org.apache.hadoop.hbase.io.encoding.HFileBlockDefaultDecodingContext;
@@ -870,7 +870,7 @@ public class HFileBlock implements Cacheable {
      * part of onDiskBytesWithHeader. If data is uncompressed, then this
      * variable stores the checksum data for this block.
      */
-    private byte[] onDiskChecksum;
+    private byte[] onDiskChecksum = HConstants.EMPTY_BYTE_ARRAY;
 
     /**
      * Valid in the READY state. Contains the header and the uncompressed (but
@@ -1039,7 +1039,9 @@ public class HFileBlock implements Cacheable {
           onDiskBlockBytesWithHeader.length + numBytes,
           uncompressedBlockBytesWithHeader.length, onDiskBlockBytesWithHeader.length);
       }
-      onDiskChecksum = new byte[numBytes];
+      if (onDiskChecksum.length != numBytes) {
+        onDiskChecksum = new byte[numBytes];
+      }
       ChecksumUtil.generateChecksums(
           onDiskBlockBytesWithHeader, 0, onDiskBlockBytesWithHeader.length,
           onDiskChecksum, 0, fileContext.getChecksumType(), fileContext.getBytesPerChecksum());


[2/3] hbase git commit: HBASE-16694 Reduce garbage for onDiskChecksum in HFileBlock (binlijin)

Posted by ap...@apache.org.
HBASE-16694 Reduce garbage for onDiskChecksum in HFileBlock (binlijin)


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

Branch: refs/heads/branch-1
Commit: 67a43c30594329dc4a0de19787d2796e05f0b2c8
Parents: 4566e4d
Author: Andrew Purtell <ap...@apache.org>
Authored: Mon Sep 26 13:49:10 2016 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Mon Sep 26 13:55:28 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/67a43c30/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
index b2ed8d4..d5f5a69 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
@@ -855,7 +855,7 @@ public class HFileBlock implements Cacheable {
      * part of onDiskBytesWithHeader. If data is uncompressed, then this
      * variable stores the checksum data for this block.
      */
-    private byte[] onDiskChecksum;
+    private byte[] onDiskChecksum = HConstants.EMPTY_BYTE_ARRAY;
 
     /**
      * Valid in the READY state. Contains the header and the uncompressed (but
@@ -1027,7 +1027,9 @@ public class HFileBlock implements Cacheable {
           onDiskBlockBytesWithHeader.length + numBytes,
           uncompressedBlockBytesWithHeader.length, onDiskBlockBytesWithHeader.length);
       }
-      onDiskChecksum = new byte[numBytes];
+      if (onDiskChecksum.length != numBytes) {
+        onDiskChecksum = new byte[numBytes];
+      }
       ChecksumUtil.generateChecksums(
           onDiskBlockBytesWithHeader, 0, onDiskBlockBytesWithHeader.length,
           onDiskChecksum, 0, fileContext.getChecksumType(), fileContext.getBytesPerChecksum());