Constructor and Description |
---|
RecordCache() |
Modifier and Type | Method and Description |
---|---|
static <T> com.google.common.base.Supplier<RecordCache<T>> |
factory(int size) |
abstract RecordId |
get(T key) |
com.google.common.cache.CacheStats |
getStats() |
static <T> RecordCache<T> |
newRecordCache(int size)
Factory method for creating
RecordCache instances. |
abstract void |
put(T key,
RecordId value)
Add a mapping from
key to value . |
abstract long |
size() |
public abstract void put(@Nonnull T key, @Nonnull RecordId value)
key
to value
. Any existing mapping is replaced.@CheckForNull public abstract RecordId get(@Nonnull T key)
key
, or null
if none.public abstract long size()
public com.google.common.cache.CacheStats getStats()
@Nonnull public static <T> RecordCache<T> newRecordCache(int size)
RecordCache
instances. The returned
instances are all thread safe. They implement a simple LRU behaviour where
the least recently accessed mapping would be replaced when inserting a
new mapping would exceed size
.RecordCache
instance of the given size
.@Nonnull public static <T> com.google.common.base.Supplier<RecordCache<T>> factory(int size)
RecordCache
instances of the given size
when invoked.newRecordCache(int)
Copyright © 2012-2016 The Apache Software Foundation. All Rights Reserved.