MCPcopy Create free account
hub / github.com/antlr/codebuff / recordWrite

Method recordWrite

output/java_guava/1.4.18/LocalCache.java:2658–2671  ·  view source on GitHub ↗

Updates eviction metadata that entry was just written. This currently amounts to adding entry to relevant eviction lists.

(ReferenceEntry<K, V> entry, int weight, long now)

Source from the content-addressed store, hash-verified

2656 */
2657
2658 @GuardedBy("this")
2659 void recordWrite(ReferenceEntry<K, V> entry, int weight, long now) {
2660 // we are already under lock, so drain the recency queue immediately
2661 drainRecencyQueue();
2662 totalWeight += weight;
2663 if (map.recordsAccess()) {
2664 entry.setAccessTime(now);
2665 }
2666 if (map.recordsWrite()) {
2667 entry.setWriteTime(now);
2668 }
2669 accessQueue.add(entry);
2670 writeQueue.add(entry);
2671 }
2672
2673 /**
2674 * Drains the recency queue, updating eviction metadata that the entries therein were read in

Callers 1

setValueMethod · 0.95

Calls 6

drainRecencyQueueMethod · 0.95
setAccessTimeMethod · 0.65
setWriteTimeMethod · 0.65
addMethod · 0.65
recordsAccessMethod · 0.45
recordsWriteMethod · 0.45

Tested by

no test coverage detected