@Override public long heapSize() { return getCurrentSize(); }
@Override public long getFreeSize() { return getMaxSize() - getCurrentSize(); }
@Override public long getCurrentSize() { return onHeapCache.getCurrentSize() + l2Cache.getCurrentSize(); }
assertEquals(cache.getOverhead(), cache.getCurrentSize());
@Override public String toString() { return MoreObjects.toStringHelper(this) .add("blockCount", getBlockCount()) .add("currentSize", StringUtils.byteDesc(getCurrentSize())) .add("freeSize", StringUtils.byteDesc(getFreeSize())) .add("maxSize", StringUtils.byteDesc(getMaxSize())) .add("heapSize", StringUtils.byteDesc(heapSize())) .add("minSize", StringUtils.byteDesc(minSize())) .add("minFactor", minFactor) .add("multiSize", StringUtils.byteDesc(multiSize())) .add("multiFactor", multiFactor) .add("singleSize", StringUtils.byteDesc(singleSize())) .add("singleFactor", singleFactor) .toString(); }
@Override public long heapSize() { return getCurrentSize(); }
public long heapSize() { return getCurrentSize(); }
/** * Get the current size of this cache. * @return current size in bytes */ public long getFreeSize() { return getMaxSize() - getCurrentSize(); }
@Override public long getCurrentSize() { return lruCache.getCurrentSize() + l2Cache.getCurrentSize(); }
@Override public long getFreeSize() { return getMaxSize() - getCurrentSize(); }
public long getCurrentSize() { return onHeapCache.getCurrentSize() + offHeapCache.getCurrentSize(); }
/** * Evict the block, and it will be cached by the victim handler if exists && * block may be read again later * @param block * @param evictedByEvictionProcess true if the given block is evicted by * EvictionThread * @return the heap size of evicted block */ protected long evictBlock(LruCachedBlock block, boolean evictedByEvictionProcess) { map.remove(block.getCacheKey()); updateSizeMetrics(block, true); long val = elements.decrementAndGet(); if (LOG.isTraceEnabled()) { long size = map.size(); assertCounterSanity(size, val); } stats.evicted(block.getCachedTime(), block.getCacheKey().isPrimary()); if (evictedByEvictionProcess && victimHandler != null) { if (victimHandler instanceof BucketCache) { boolean wait = getCurrentSize() < acceptableSize(); boolean inMemory = block.getPriority() == BlockPriority.MEMORY; ((BucketCache)victimHandler).cacheBlockWithWait(block.getCacheKey(), block.getBuffer(), inMemory, wait); } else { victimHandler.cacheBlock(block.getCacheKey(), block.getBuffer()); } } return block.heapSize(); }
assertEquals(cache.getOverhead(), cache.getCurrentSize());
@Override public String toString() { return Objects.toStringHelper(this) .add("blockCount", getBlockCount()) .add("currentSize", getCurrentSize()) .add("freeSize", getFreeSize()) .add("maxSize", getMaxSize()) .add("heapSize", heapSize()) .add("minSize", minSize()) .add("minFactor", minFactor) .add("multiSize", multiSize()) .add("multiFactor", multiFactor) .add("singleSize", singleSize()) .add("singleFactor", singleFactor) .toString(); }