HBASE-22441 BucketCache NullPointerException in cacheBlock

This commit is contained in:
binlijin 2019-05-27 17:14:42 +08:00
parent 998b8416ca
commit 5dcfe5f8d8
1 changed files with 4 additions and 0 deletions

View File

@ -229,6 +229,10 @@ public class BlockCacheUtil {
public static boolean shouldReplaceExistingCacheBlock(BlockCache blockCache,
BlockCacheKey cacheKey, Cacheable newBlock) {
Cacheable existingBlock = blockCache.getBlock(cacheKey, false, false, false);
if (null == existingBlock) {
// Not exist now.
return true;
}
try {
int comparison = BlockCacheUtil.validateBlockAddition(existingBlock, newBlock, cacheKey);
if (comparison < 0) {