@ThreadSafe public class LevelDBCacheStore extends LockSupportCacheStore<Integer>
multiThreadedPurge, purgerServicecache, 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, upgradeLockapplyModifications, commit, getCacheStoreConfig, getConcurrencyLevel, getMarshaller, prepare, purgeExpired, removeAll, rollback, safeClose, safeClose, supportsMultiThreadedPurgecontainsKeyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsKeypublic Class<? extends CacheLoaderConfig> getConfigurationClass()
CacheLoaderCacheLoaderConfig 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
CacheLoaderCacheLoaderManager
when setting up cache loaders.init in interface CacheLoaderinit 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.CacheLoaderExceptionpublic void start()
throws CacheLoaderException
start in interface CacheLoaderstart in class LockSupportCacheStore<Integer>CacheLoaderExceptionprotected org.iq80.leveldb.DB openDatabase(String location, org.iq80.leveldb.Options options) throws IOException
IOExceptionprotected void destroyDatabase(String location) throws IOException
IOExceptionprotected org.iq80.leveldb.DB reinitDatabase(String location, org.iq80.leveldb.Options options) throws IOException
IOExceptionprotected void reinitAllDatabases()
throws IOException
IOExceptionpublic void stop()
throws CacheLoaderException
stop in interface CacheLoaderstop in class AbstractCacheStoreCacheLoaderExceptionprotected void clearLockSafe()
throws CacheLoaderException
clearLockSafe in class LockSupportCacheStore<Integer>CacheLoaderExceptionprotected Set<InternalCacheEntry> loadAllLockSafe() throws CacheLoaderException
loadAllLockSafe in class LockSupportCacheStore<Integer>CacheLoaderExceptionprotected Set<InternalCacheEntry> loadLockSafe(int maxEntries) throws CacheLoaderException
loadLockSafe in class LockSupportCacheStore<Integer>CacheLoaderExceptionprotected Set<Object> loadAllKeysLockSafe(Set<Object> keysToExclude) throws CacheLoaderException
loadAllKeysLockSafe in class LockSupportCacheStore<Integer>CacheLoaderExceptionprotected void toStreamLockSafe(ObjectOutput oos) throws CacheLoaderException
toStreamLockSafe in class LockSupportCacheStore<Integer>CacheLoaderExceptionprotected void fromStreamLockSafe(ObjectInput ois) throws CacheLoaderException
fromStreamLockSafe in class LockSupportCacheStore<Integer>CacheLoaderExceptionprotected boolean removeLockSafe(Object key, Integer lockingKey) throws CacheLoaderException
removeLockSafe in class LockSupportCacheStore<Integer>CacheLoaderExceptionprotected void storeLockSafe(InternalCacheEntry ed, Integer lockingKey) throws CacheLoaderException
storeLockSafe in class LockSupportCacheStore<Integer>CacheLoaderExceptionprotected InternalCacheEntry loadLockSafe(Object key, Integer lockingKey) throws CacheLoaderException
loadLockSafe in class LockSupportCacheStore<Integer>CacheLoaderExceptionprotected Integer getLockFromKey(Object key) throws CacheLoaderException
getLockFromKey in class LockSupportCacheStore<Integer>CacheLoaderExceptionprotected void purgeInternal()
throws CacheLoaderException
purgeInternal in class AbstractCacheStoreCacheLoaderExceptionCopyright © 2017 JBoss, a division of Red Hat. All Rights Reserved.