HBASE-22441 BucketCache NullPointerException in cacheBlock
This commit is contained in:
parent
998b8416ca
commit
5dcfe5f8d8
|
@ -229,6 +229,10 @@ public class BlockCacheUtil {
|
||||||
public static boolean shouldReplaceExistingCacheBlock(BlockCache blockCache,
|
public static boolean shouldReplaceExistingCacheBlock(BlockCache blockCache,
|
||||||
BlockCacheKey cacheKey, Cacheable newBlock) {
|
BlockCacheKey cacheKey, Cacheable newBlock) {
|
||||||
Cacheable existingBlock = blockCache.getBlock(cacheKey, false, false, false);
|
Cacheable existingBlock = blockCache.getBlock(cacheKey, false, false, false);
|
||||||
|
if (null == existingBlock) {
|
||||||
|
// Not exist now.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
int comparison = BlockCacheUtil.validateBlockAddition(existingBlock, newBlock, cacheKey);
|
int comparison = BlockCacheUtil.validateBlockAddition(existingBlock, newBlock, cacheKey);
|
||||||
if (comparison < 0) {
|
if (comparison < 0) {
|
||||||
|
|
Loading…
Reference in New Issue