statsCounter().recordMisses(misses); statsCounter().recordHits(result.size());
/** * Performs the post-processing work required after a read. * * @param node the entry in the page replacement policy * @param now the current time, in nanoseconds * @param recordHit if the hit count should be incremented */ void afterRead(Node<K, V> node, long now, boolean recordHit) { if (recordHit) { statsCounter().recordHits(1); } boolean delayable = skipReadBuffer() || (readBuffer.offer(node) != Buffer.FULL); if (shouldDrainBuffers(delayable)) { scheduleDrainBuffers(); } refreshIfNeeded(node, now); }
@Override public @Nullable V getIfPresent(Object key, boolean recordStats) { Node<K, V> node = data.get(nodeFactory.newLookupKey(key)); if (node == null) { if (recordStats) { statsCounter().recordMisses(1); } return null; } V value = node.getValue(); long now = expirationTicker().read(); if (hasExpired(node, now) || (collectValues() && (value == null))) { if (recordStats) { statsCounter().recordMisses(1); } scheduleDrainBuffers(); return null; } if (!isComputingAsync(node)) { @SuppressWarnings("unchecked") K castedKey = (K) key; setAccessTime(node, now); setVariableTime(node, expireAfterRead(node, castedKey, value, expiry(), now)); } afterRead(node, now, recordStats); return value; }
logger.log(Level.WARNING, "Exception thrown during refresh", error); node.casWriteTime(refreshWriteTime, oldWriteTime); statsCounter().recordLoadFailure(loadTime); return; statsCounter().recordLoadFailure(loadTime); } else { statsCounter().recordLoadSuccess(loadTime);
notifyRemoval(nodeKey[0], oldValue[0], cause[0]); statsCounter().recordEviction(weight[0]);
statsCounter().recordEviction(weight[0]);
statsCounter().recordMisses(misses); statsCounter().recordHits(result.size());
statsCounter().recordEviction(node.getWeight()); if (hasRemovalListener()) {
/** * Performs the post-processing work required after a read. * * @param node the entry in the page replacement policy * @param now the current time, in nanoseconds * @param recordHit if the hit count should be incremented */ void afterRead(Node<K, V> node, long now, boolean recordHit) { if (recordHit) { statsCounter().recordHits(1); } boolean delayable = skipReadBuffer() || (readBuffer.offer(node) != Buffer.FULL); if (shouldDrainBuffers(delayable)) { scheduleDrainBuffers(); } refreshIfNeeded(node, now); }
@Override public @Nullable V getIfPresent(Object key, boolean recordStats) { Node<K, V> node = data.get(nodeFactory.newLookupKey(key)); if (node == null) { if (recordStats) { statsCounter().recordMisses(1); } return null; } long now = expirationTicker().read(); if (hasExpired(node, now)) { if (recordStats) { statsCounter().recordMisses(1); } scheduleDrainBuffers(); return null; } @SuppressWarnings("unchecked") K castedKey = (K) key; V value = node.getValue(); if (!isComputingAsync(node)) { setVariableTime(node, expireAfterRead(node, castedKey, value, expiry(), now)); setAccessTime(node, now); } afterRead(node, now, recordStats); return value; }
logger.log(Level.WARNING, "Exception thrown during refresh", error); node.casWriteTime(refreshWriteTime, oldWriteTime); statsCounter().recordLoadFailure(loadTime); return; statsCounter().recordLoadFailure(loadTime); } else { statsCounter().recordLoadSuccess(loadTime);
notifyRemoval(nodeKey[0], oldValue[0], cause[0]); statsCounter().recordEviction(weight[0]);
statsCounter().recordEviction(weight[0]);
statsCounter().recordEviction(node.getWeight()); if (hasRemovalListener()) {