private boolean doEvictBlock(BlockCacheKey cacheKey, BucketEntry bucketEntry,
    boolean evictedByEvictionProcess) {
    if (!isCacheEnabled()) {
      return false;
    }
    boolean existedInRamCache = removeFromRamCache(cacheKey);
    if (bucketEntry == null) {
      bucketEntry = backingMap.get(cacheKey);
    }
    final BucketEntry bucketEntryToUse = bucketEntry;

    if (bucketEntryToUse == null) {
      if (existedInRamCache && evictedByEvictionProcess) {
        cacheStats.evicted(0, cacheKey.isPrimary());
      }
      return existedInRamCache;
    } else {
      return bucketEntryToUse.withWriteLock(offsetLock, () -> {
        if (backingMap.remove(cacheKey, bucketEntryToUse)) {
          LOG.debug("removed key {} from back map with offset lock {} in the evict process",
            cacheKey, bucketEntryToUse.offset());
          blockEvicted(cacheKey, bucketEntryToUse, !existedInRamCache, evictedByEvictionProcess);
          return true;
        }
        return false;
      });
    }
  }
Evict the {@link BlockCacheKey} and {@link BucketEntry} from {@link BucketCache#backingMap} and
{@link BucketCache#ramCache}. <br/>
NOTE:When Evict from {@link BucketCache#backingMap},only the matched {@link BlockCacheKey} and
{@link BucketEntry} could be removed.
@param cacheKey    {@link BlockCacheKey} to evict.
@param bucketEntry {@link BucketEntry} matched {@link BlockCacheKey} to evict.
@return true to indicate whether we've evicted successfully or not.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java