public class MetaDataVersionStampStoreStateCacheFactory extends Object implements FDBRecordStoreStateCacheFactory
MetaDataVersionStampStoreStateCache
s.Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_EXPIRE_AFTER_ACCESS_MILLIS
The default amount of time in milliseconds after last access that cache entries should start to be expired.
|
static long |
DEFAULT_MAX_SIZE
The default maximum number of items to include in the cache.
|
static long |
UNLIMITED
A constant indicating that the cache should be of unlimited size or keep items for an unlimited time.
|
Constructor and Description |
---|
MetaDataVersionStampStoreStateCacheFactory() |
Modifier and Type | Method and Description |
---|---|
FDBRecordStoreStateCache |
getCache(FDBDatabase database)
Produce a
FDBRecordStoreStateCache . |
long |
getDefaultExpireAfterAccessMillis()
Get the amount of time in milliseconds that each entry is kept in each cache after its last access.
|
long |
getMaxSize()
Get the maximum number of elements to keep in produced caches.
|
static MetaDataVersionStampStoreStateCacheFactory |
newInstance()
Create a new factory.
|
MetaDataVersionStampStoreStateCacheFactory |
setExpireAfterAccessMillis(long expireAfterAccessMillis)
Set the number of milliseconds to keep an item in produced caches after it has been accessed.
|
MetaDataVersionStampStoreStateCacheFactory |
setMaxSize(long maxSize)
Set the maximum number of elements to keep in produced caches.
|
public static final long UNLIMITED
public static final long DEFAULT_MAX_SIZE
public static final long DEFAULT_EXPIRE_AFTER_ACCESS_MILLIS
public MetaDataVersionStampStoreStateCacheFactory()
@Nonnull public FDBRecordStoreStateCache getCache(@Nonnull FDBDatabase database)
FDBRecordStoreStateCacheFactory
FDBRecordStoreStateCache
. Two instances produced by this factory should not
share any common state as they should not be assumed to cache store information for record stores
from the same database.getCache
in interface FDBRecordStoreStateCacheFactory
database
- the database that the produced cache will be used withFDBRecordStoreStateCache
@Nonnull public MetaDataVersionStampStoreStateCacheFactory setExpireAfterAccessMillis(long expireAfterAccessMillis)
UNLIMITED
to indicate that the items in caches produced
by this factory should not be limited by time.expireAfterAccessMillis
- the amount of time to keep the item in each cache after last accesspublic long getDefaultExpireAfterAccessMillis()
@Nonnull public MetaDataVersionStampStoreStateCacheFactory setMaxSize(long maxSize)
UNLIMITED
to
indicate that no maximum size should be imposed on the number of items in each cache.maxSize
- the maximum number of elements to keep in each cachepublic long getMaxSize()
@Nonnull public static MetaDataVersionStampStoreStateCacheFactory newInstance()
MetaDataVersionStampStoreStateCache
s