HBASE-13072 BucketCache.evictBlock returns true if block does not exist (Duo Zhang)
This commit is contained in:
parent
31f17b17f0
commit
18402cc850
|
@ -451,7 +451,14 @@ public class BucketCache implements BlockCache, HeapSize {
|
|||
this.heapSize.addAndGet(-1 * removedBlock.getData().heapSize());
|
||||
}
|
||||
BucketEntry bucketEntry = backingMap.get(cacheKey);
|
||||
if (bucketEntry != null) {
|
||||
if (bucketEntry == null) {
|
||||
if (removedBlock != null) {
|
||||
cacheStats.evicted(0);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
IdLock.Entry lockEntry = null;
|
||||
try {
|
||||
lockEntry = offsetLock.getLockEntry(bucketEntry.offset());
|
||||
|
@ -473,8 +480,7 @@ public class BucketCache implements BlockCache, HeapSize {
|
|||
offsetLock.releaseLockEntry(lockEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
cacheStats.evicted(bucketEntry == null? 0: bucketEntry.getCachedTime());
|
||||
cacheStats.evicted(bucketEntry.getCachedTime());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue