public class CloudCacheStore extends BucketBasedCacheStore
BucketBasedCacheStore.BucketHandler, BucketBasedCacheStore.CollectionGeneratingBucketHandler<T>
Modifier and Type | Field and Description |
---|---|
protected static String |
EARLIEST_EXPIRY_TIME |
multiThreadedPurge, purgerService
cache, marshaller
Constructor and Description |
---|
CloudCacheStore() |
Modifier and Type | Method and Description |
---|---|
void |
applyModifications(List<? extends Modification> modifications) |
protected void |
clearLockSafe() |
protected void |
fromStreamLockSafe(ObjectInput objectInput) |
Class<? extends CacheStoreConfig> |
getConfigurationClass()
This method is used by the configuration parser to get a hold of the CacheLoader implementation's corresponding
CacheLoaderConfig type. |
void |
init(CacheLoaderConfig cfg,
Cache<?,?> cache,
StreamingMarshaller m)
Used to initialize a cache loader.
|
void |
init(CacheLoaderConfig cfg,
Cache<?,?> cache,
StreamingMarshaller m,
org.jclouds.blobstore.BlobStoreContext ctx,
org.jclouds.blobstore.BlobStore blobStore,
org.jclouds.blobstore.AsyncBlobStore asyncBlobStore,
boolean constructInternalBlobstores) |
protected Bucket |
loadBucket(Integer hash)
Loads a Bucket from the store, based on the hash code of the bucket.
|
protected void |
loopOverBuckets(BucketBasedCacheStore.BucketHandler handler)
A mechanism to loop over all buckets in the cache store.
|
protected void |
purgeInternal() |
void |
start() |
protected boolean |
supportsMultiThreadedPurge() |
protected void |
toStreamLockSafe(ObjectOutput objectOutput) |
protected void |
updateBucket(Bucket bucket)
Updates a bucket in the store with the Bucket passed in to the method.
|
getLockFromKey, insertBucket, loadAllKeysLockSafe, loadAllLockSafe, loadLockSafe, loadLockSafe, removeLockSafe, storeLockSafe
acquireGlobalLock, clear, downgradeLock, fromStream, getTotalLockCount, immediateLockForWriting, load, load, loadAll, loadAllKeys, lockForReading, lockForWriting, releaseGlobalLock, remove, store, toStream, unlock, upgradeLock
commit, getCacheStoreConfig, getConcurrencyLevel, getMarshaller, prepare, purgeExpired, removeAll, rollback, safeClose, safeClose, stop
containsKey
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsKey
protected static final String EARLIEST_EXPIRY_TIME
public Class<? extends CacheStoreConfig> 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
.protected boolean supportsMultiThreadedPurge()
supportsMultiThreadedPurge
in class AbstractCacheStore
public void init(CacheLoaderConfig cfg, Cache<?,?> cache, StreamingMarshaller m) throws CacheLoaderException
CacheLoader
CacheLoaderManager
when setting up cache loaders.init
in interface CacheLoader
init
in class LockSupportCacheStore<Integer>
cfg
- 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 init(CacheLoaderConfig cfg, Cache<?,?> cache, StreamingMarshaller m, org.jclouds.blobstore.BlobStoreContext ctx, org.jclouds.blobstore.BlobStore blobStore, org.jclouds.blobstore.AsyncBlobStore asyncBlobStore, boolean constructInternalBlobstores) throws CacheLoaderException
CacheLoaderException
public void start() throws CacheLoaderException
start
in interface CacheLoader
start
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected void loopOverBuckets(BucketBasedCacheStore.BucketHandler handler) throws CacheLoaderException
BucketBasedCacheStore
BucketBasedCacheStore.BucketHandler.handle(Bucket)
returns true or there are no more buckets available.
loopOverBuckets
in class BucketBasedCacheStore
CacheLoaderException
protected void fromStreamLockSafe(ObjectInput objectInput) throws CacheLoaderException
fromStreamLockSafe
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected void toStreamLockSafe(ObjectOutput objectOutput) throws CacheLoaderException
toStreamLockSafe
in class LockSupportCacheStore<Integer>
CacheLoaderException
protected void clearLockSafe()
clearLockSafe
in class LockSupportCacheStore<Integer>
protected Bucket loadBucket(Integer hash) throws CacheLoaderException
BucketBasedCacheStore
loadBucket
in class BucketBasedCacheStore
hash
- the Bucket's hashCacheLoaderException
- in case of problems with the store.protected void purgeInternal() throws CacheLoaderException
purgeInternal
in class AbstractCacheStore
CacheLoaderException
protected void updateBucket(Bucket bucket) throws CacheLoaderException
BucketBasedCacheStore
BucketBasedCacheStore.insertBucket(Bucket)
as well so that it doesn't blindly
forward calls to BucketBasedCacheStore.updateBucket(Bucket)
.
updateBucket
in class BucketBasedCacheStore
bucket
- bucket to update.CacheLoaderException
- in case of problems with the store.public void applyModifications(List<? extends Modification> modifications) throws CacheLoaderException
applyModifications
in class AbstractCacheStore
CacheLoaderException
Copyright © 2017 JBoss, a division of Red Hat. All Rights Reserved.