You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ch...@apache.org on 2016/07/02 01:05:34 UTC
hbase git commit: HBASE-15844 We should respect
hfile.block.index.cacheonwrite when write intermediate index Block
Repository: hbase
Updated Branches:
refs/heads/master af9422c04 -> 561eb8296
HBASE-15844 We should respect hfile.block.index.cacheonwrite when write intermediate index Block
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/561eb829
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/561eb829
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/561eb829
Branch: refs/heads/master
Commit: 561eb82968360cd571f897a0f28f8f6e853e85ab
Parents: af9422c
Author: chenheng <ch...@apache.org>
Authored: Sat Jul 2 09:04:15 2016 +0800
Committer: chenheng <ch...@apache.org>
Committed: Sat Jul 2 09:04:15 2016 +0800
----------------------------------------------------------------------
.../org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/561eb829/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java
index 76fec06..66968e0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java
@@ -1072,6 +1072,11 @@ public class HFileBlockIndex {
if (midKeyMetadata != null)
blockStream.write(midKeyMetadata);
blockWriter.writeHeaderAndData(out);
+ if (cacheConf != null) {
+ HFileBlock blockForCaching = blockWriter.getBlockForCaching(cacheConf);
+ cacheConf.getBlockCache().cacheBlock(new BlockCacheKey(nameForCaching,
+ rootLevelIndexPos, true, blockForCaching.getBlockType()), blockForCaching);
+ }
}
// Add root index block size
@@ -1167,7 +1172,7 @@ public class HFileBlockIndex {
byte[] curFirstKey = curChunk.getBlockKey(0);
blockWriter.writeHeaderAndData(out);
- if (cacheConf != null) {
+ if (getCacheOnWrite()) {
HFileBlock blockForCaching = blockWriter.getBlockForCaching(cacheConf);
cacheConf.getBlockCache().cacheBlock(new BlockCacheKey(nameForCaching,
beginOffset, true, blockForCaching.getBlockType()), blockForCaching);