@Override public boolean evictBlock(BlockCacheKey cacheKey) { try { cacheStats.evict(); return client.delete(cacheKey.toString()).get(); } catch (InterruptedException e) { LOG.warn("Error deleting " + cacheKey.toString(), e); Thread.currentThread().interrupt(); } catch (ExecutionException e) { if (LOG.isDebugEnabled()) { LOG.debug("Error deleting " + cacheKey.toString(), e); } } return false; }
@Override public boolean evictBlock(BlockCacheKey cacheKey) { stats.evict(); boolean cacheA = onHeapCache.evictBlock(cacheKey); boolean cacheB = offHeapCache.evictBlock(cacheKey); boolean evicted = cacheA || cacheB; if (evicted) { stats.evicted(); } return evicted; }
stats.evict(); evictionInProgress = false; evictionLock.unlock();
/** * Evicts the block * * @param key the key of the entry we are going to evict * @return the evicted ByteBuffer */ public boolean evictBlock(BlockCacheKey key) { stats.evict(); CacheablePair evictedBlock = backingMap.remove(key); if (evictedBlock != null) { doEviction(key, evictedBlock); } return evictedBlock != null; }
@Override public void onRemoval( RemovalNotification<BlockCacheKey, CacheablePair> notification) { if (!notification.wasEvicted()) { // Only process removals by eviction, not by replacement or // explicit removal return; } CacheablePair value = notification.getValue(); timeSinceLastAccess.set(System.nanoTime() - value.recentlyAccessed.get()); stats.evict(); doEviction(notification.getKey(), value); } };
@Override public boolean evictBlock(BlockCacheKey cacheKey) { try { cacheStats.evict(); return client.delete(cacheKey.toString()).get(); } catch (InterruptedException e) { LOG.warn("Error deleting " + cacheKey.toString(), e); Thread.currentThread().interrupt(); } catch (ExecutionException e) { if (LOG.isDebugEnabled()) { LOG.debug("Error deleting " + cacheKey.toString(), e); } } return false; }
stats.evict(); evictionInProgress = false; evictionLock.unlock();
stats.evict(); evictionInProgress = false; evictionLock.unlock();