private void invalidateStoreGetCache() { final int storeGetCacheSize = ec.getEnvStoreGetCacheSize(); storeGetCache = storeGetCacheSize == 0 ? null : new StoreGetCache(storeGetCacheSize, ec.getEnvStoreGetCacheMinTreeSize(), ec.getEnvStoreGetCacheMaxValueSize()); }
if (storeGetCache != null) { final long treeRootAddress = tree.getRootAddress(); final boolean useStoreGetCache = treeRootAddress != Loggable.NULL_ADDRESS && tree.getSize() >= storeGetCache.getMinTreeSize(); ByteIterable result = storeGetCache.tryKey(treeRootAddress, key); if (result != null) { return result == NULL_CACHED_VALUE ? null : result; cachedValue = new ArrayByteIterable(result); if (cachedValue.getLength() <= storeGetCache.getMaxValueSize()) { storeGetCache.cacheObject(treeRootAddress, key, cachedValue);
@Override public double getMean() { final EnvironmentStatistics statistics = (EnvironmentStatistics) getStatistics(); if (statistics == null) { return 0; } @Nullable final StoreGetCache storeGetCache = statistics.env.getStoreGetCache(); return storeGetCache == null ? 0 : storeGetCache.hitRate(); } }