public class LruCache<Key,Value extends CanEstimateSize>
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
LruCache.CreateAction<Key,Value> |
When the entry is not present in cache, this create action is used to create one.
|
static interface |
LruCache.EvictAction<Value> |
Action that is invoked when the entry is removed from the cache.
|
| Modifier and Type | Field | Description |
|---|---|---|
static LruCache.CreateAction |
NOOP_CREATE_ACTION |
|
static LruCache.EvictAction |
NOOP_EVICT_ACTION |
| Constructor | Description |
|---|---|
LruCache(int maxSizeEntries,
long maxSizeBytes,
boolean accessOrder) |
|
LruCache(int maxSizeEntries,
long maxSizeBytes,
boolean accessOrder,
LruCache.CreateAction<Key,Value> createAction,
LruCache.EvictAction<Value> onEvict) |
public static final LruCache.CreateAction NOOP_CREATE_ACTION
public static final LruCache.EvictAction NOOP_EVICT_ACTION
public LruCache(int maxSizeEntries,
long maxSizeBytes,
boolean accessOrder)
public LruCache(int maxSizeEntries,
long maxSizeBytes,
boolean accessOrder,
LruCache.CreateAction<Key,Value> createAction,
LruCache.EvictAction<Value> onEvict)
public Value get(Key key)
key - cache keypublic Value borrow(Key key) throws java.sql.SQLException
key - cache keyjava.sql.SQLException - if entry creation failsCopyright © 2018 PostgreSQL Global Development Group. All rights reserved.