@ThreadSafe public class LevelDBCacheStore extends LockSupportCacheStore<Integer>
multiThreadedPurge, purgerService
cache, marshaller
Constructor and Description |
---|
LevelDBCacheStore() |
Modifier and Type | Method and Description |
---|---|
protected void |
clearLockSafe() |
protected void |
destroyDatabase(String location) |
protected void |
fromStreamLockSafe(ObjectInput ois) |
Class<? extends CacheLoaderConfig> |
getConfigurationClass()
This method is used by the configuration parser to get a hold of the CacheLoader implementation's corresponding
CacheLoaderConfig type. |
protected Integer |
getLockFromKey(Object key) |
void |
init(CacheLoaderConfig config,
Cache<?,?> cache,
StreamingMarshaller m)
Used to initialize a cache loader.
|
protected Set<Object> |
loadAllKeysLockSafe(Set<Object> keysToExclude) |
protected Set<InternalCacheEntry> |
loadAllLockSafe() |
protected Set<InternalCacheEntry> |
loadLockSafe(int maxEntries) |
protected InternalCacheEntry |
loadLockSafe(Object key,
Integer lockingKey) |
protected org.iq80.leveldb.DB |
openDatabase(String location,
org.iq80.leveldb.Options options)
Creates database if it doesn't exist.
|
protected void |
purgeInternal() |
protected void |
reinitAllDatabases() |
protected org.iq80.leveldb.DB |
reinitDatabase(String location,
org.iq80.leveldb.Options options) |
protected boolean |
removeLockSafe(Object key,
Integer lockingKey) |
void |
start() |
void |
stop() |
protected void |
storeLockSafe(InternalCacheEntry ed,
Integer lockingKey) |
protected void |
toStreamLockSafe(ObjectOutput oos) |
acquireGlobalLock, clear, downgradeLock, fromStream, getTotalLockCount, immediateLockForWriting, load, load, loadAll, loadAllKeys, lockForReading, lockForWriting, releaseGlobalLock, remove, store, toStream, unlock, upgradeLock
applyModifications, commit, getCacheStoreConfig, getConcurrencyLevel, getMarshaller, prepare, purgeExpired, removeAll, rollback, safeClose, safeClose, supportsMultiThreadedPurge
containsKey
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsKey
public Class<? extends CacheLoaderConfig> getConfigurationClass()
CacheLoader
CacheLoaderConfig
type. This is usually done by instantiating the CacheLoader
and then calling this method. This may result in 2 instances being created, however, since the instance
created to get a hold of the configuration type is then discarded and another instance is created for actual
use as a CacheLoader when the cache starts.
Since Infinispan 4.1, you can also annotate your CacheLoader implementation with CacheLoaderMetadata
and provide this information via the annotation, which will prevent unnecessary instances being created.
CacheLoaderConfig
bean used to configure this
implementation of CacheLoader
.public void init(CacheLoaderConfig config, Cache<?,?> cache, StreamingMarshaller m) throws CacheLoaderException
CacheLoader
CacheLoaderManager
when setting up cache loaders.init
in interface CacheLoader
init
in class LockSupportCacheStore<Integer>
config
- the cache loader configuration beancache
- cache associated with this cache loader. Implementations may use this to determine cache name when
selecting where refer to state in storage, for example, a different database table name.m
- marshaller to use when loading state from a stream, if supported by the implementation.CacheLoaderException
public void start() throws CacheLoaderException
start
in interface CacheLoader
start
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected org.iq80.leveldb.DB openDatabase(String location, org.iq80.leveldb.Options options) throws IOException
IOException
protected void destroyDatabase(String location) throws IOException
IOException
protected org.iq80.leveldb.DB reinitDatabase(String location, org.iq80.leveldb.Options options) throws IOException
IOException
protected void reinitAllDatabases() throws IOException
IOException
public void stop() throws CacheLoaderException
stop
in interface CacheLoader
stop
in class AbstractCacheStore
CacheLoaderException
protected void clearLockSafe() throws CacheLoaderException
clearLockSafe
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected Set<InternalCacheEntry> loadAllLockSafe() throws CacheLoaderException
loadAllLockSafe
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected Set<InternalCacheEntry> loadLockSafe(int maxEntries) throws CacheLoaderException
loadLockSafe
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected Set<Object> loadAllKeysLockSafe(Set<Object> keysToExclude) throws CacheLoaderException
loadAllKeysLockSafe
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected void toStreamLockSafe(ObjectOutput oos) throws CacheLoaderException
toStreamLockSafe
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected void fromStreamLockSafe(ObjectInput ois) throws CacheLoaderException
fromStreamLockSafe
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected boolean removeLockSafe(Object key, Integer lockingKey) throws CacheLoaderException
removeLockSafe
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected void storeLockSafe(InternalCacheEntry ed, Integer lockingKey) throws CacheLoaderException
storeLockSafe
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected InternalCacheEntry loadLockSafe(Object key, Integer lockingKey) throws CacheLoaderException
loadLockSafe
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected Integer getLockFromKey(Object key) throws CacheLoaderException
getLockFromKey
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected void purgeInternal() throws CacheLoaderException
purgeInternal
in class AbstractCacheStore
CacheLoaderException
Copyright © 2017 JBoss, a division of Red Hat. All Rights Reserved.