Class DirectTriggerService.RecentEntries<K,V>

java.lang.Object
org.chenile.trigger.DirectTriggerService.RecentEntries<K,V>
Enclosing class:
DirectTriggerService

private static class DirectTriggerService.RecentEntries<K,V> extends Object
A thread-safe map that forgets entries after a time to live and keeps at most a fixed number of them, dropping the oldest first. Holds the accepted keys and the statuses.
  • Field Details

  • Constructor Details

    • RecentEntries

      RecentEntries(Duration timeToLive, int maxEntries, Clock clock)
  • Method Details

    • putIfAbsent

      V putIfAbsent(K key, Function<K,V> value)
      Returns the live value for the key, or stores the computed one and returns it.
    • get

      V get(K key)
    • put

      void put(K key, V value)
    • remove

      void remove(K key)
    • evict

      private void evict()