Class IdleScan

  • All Implemented Interfaces:
    NeedsClose

    public class IdleScan
    extends Object
    implements NeedsClose
    Scans for idle entries. This uses a scheduler to wakeup in regular intervals and adds additional scans in the eviction and eventually evicts the entry if it had no access since the last scan round. The duration of the scan round is controlled via Cache2kBuilder.idleScanTime(long, TimeUnit) If there is normal eviction activity in the cache, e.g. when a capacity limit is configured, only the difference of scans is executed to achieve the configured scan time to cover all cached entries. If eviction scans are more than needed for a the scan round time, the processing stops and waits for a full round duration.
    Author:
    Jens Wilke
    • Constructor Detail

      • IdleScan

        public IdleScan​(org.cache2k.operation.TimeReference clock,
                        org.cache2k.operation.Scheduler scheduler,
                        Eviction eviction,
                        long roundTicks)