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)
| 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 |
no test coverage detected