hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject [06/50] [abbrv] hbase git commit: HBASE-15477 Purge 'next block header' from cached blocks
Date Wed, 30 Mar 2016 16:03:08 GMT
HBASE-15477 Purge 'next block header' from cached blocks

When we read from HDFS, we overread to pick up the next blocks header.
Doing this saves a seek as we move through the hfile; we save having to
do an explicit seek just to read the block header every time we need to
read the body.  We used to read in the next header as part of the
current blocks buffer. This buffer was then what got persisted to
blockcache; so we were over-persisting: our block plus the next blocks'
header (33 bytes).

This patch undoes this over-persisting.

Removes support for version 1 blocks (0.2 was added in hbase-0.92.0).
Not needed any more.

There is an open question on whether checksums should be persisted
when caching. The code seems to say no but if cache is SSD backed or
backed by anything that does not do error correction, we'll want
checksums.

Adds loads of documentation.

M hbase-common/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockType.java
  (write) Add writing from a ByteBuff.

M hbase-common/src/main/java/org/apache/hadoop/hbase/nio/ByteBuff.java
  (toString) Add one so ByteBuff looks like ByteBuffer when you click on
  it in IDE

M hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
  Remove support for version 1 blocks.

  Cleaned up handling of metadata added when we serialize a block to
  caches. Metadata is smaller now.

  When we serialize (used when caching), do not persist the next blocks
  header if present.

  Removed a bunch of methods, a few of which had overlapping
  functionality and others that exposed too much of our internals.
  Also removed a bunch of constructors and unified the constructors we
  had left over making them share a common init method.
  Shutdown access to defines that should only be used internally here.

  Renamed all to do w/ 'EXTRA' and 'extraSerialization' to instead talk
  about metadata saved to caches; was unclear previously what EXTRA was
  about.

  Renamed static final declarations as all uppercase.

  (readBlockDataInternal): Redid. Couldn't make sense of it previously.
  Undid heavy-duty parse of header by constructing HFileBlock. Other
  cleanups. Its 1/3rd the length it used to be. More to do in here.


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

Branch: refs/heads/hbase-12439
Commit: ef94b552399d75c0c16aca0109a39b66f15af892
Parents: 891569b
Author: stack <stack@apache.org>
Authored: Thu Mar 17 11:18:06 2016 -0700
Committer: stack <stack@apache.org>
Committed: Tue Mar 22 13:34:51 2016 -0700

----------------------------------------------------------------------
 .../hbase/regionserver/KeyValueScanner.java.rej    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ef94b552/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueScanner.java.rej
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueScanner.java.rej
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueScanner.java.rej
new file mode 100644
index 0000000..4e3ebd4
--- /dev/null
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueScanner.java.rej
@@ -0,0 +1,17 @@
+diff a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueScanner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueScanner.java	(rejected
hunks)
+@@ -29,7 +30,7 @@ import org.apache.hadoop.hbase.client.Scan;
+  * Scanner that returns the next KeyValue.
+  */
+ @InterfaceAudience.Private
+-public interface KeyValueScanner extends Shipper {
++public interface KeyValueScanner extends Shipper, Closeable {
+   /**
+    * The byte array represents for NO_NEXT_INDEXED_KEY;
+    * The actual value is irrelevant because this is always compared by reference.
+@@ -165,4 +167,4 @@ public interface KeyValueScanner extends Shipper {
+    * if known, or null otherwise
+    */
+   public Cell getNextIndexedKey();
+-}
++}
+\ No newline at end of file


Mime
View raw message