HBASE-23375 HBASE-22441 BucketCache NullPointerException in cacheBlock
branches-1 backport. closes #907 Co-authored-by: binlijin <binlijin@apache.org> Signed-off-by: binlijin <binlijin@apache.org> Signed-off-by: Viraj Jasani <virajjasani007@gmail.com> Signed-off-by: Sean Busbey <busbey@apache.org>
This commit is contained in:
parent
84c0a90ba4
commit
28673f0c22
|
@ -230,6 +230,9 @@ public class BlockCacheUtil {
|
|||
public static boolean shouldReplaceExistingCacheBlock(BlockCache blockCache,
|
||||
BlockCacheKey cacheKey, Cacheable newBlock) {
|
||||
Cacheable existingBlock = blockCache.getBlock(cacheKey, false, false, false);
|
||||
if (existingBlock == null) {
|
||||
return true;
|
||||
}
|
||||
int comparison = BlockCacheUtil.validateBlockAddition(existingBlock, newBlock, cacheKey);
|
||||
if (comparison < 0) {
|
||||
LOG.warn("Cached block contents differ by nextBlockOnDiskSize, the new block has "
|
||||
|
|
Loading…
Reference in New Issue