Class ThreadLocalCache<K,V>

java.lang.Object
io.airlift.concurrent.ThreadLocalCache<K,V>
Type Parameters:
K - cache key type
V - cache value type

public final class ThreadLocalCache<K,V> extends Object
Provides a ThreadLocal cache with a maximum cache size per thread. Values must not be null.
  • Constructor Details

    • ThreadLocalCache

      public ThreadLocalCache(int maxSizePerThread, Function<K,V> loader)
  • Method Details

    • get

      public V get(K key)