K
- Ignite cache key type.V
- Ignite cache value type.public class CassandraCacheStore<K,V> extends Object implements CacheStore<K,V>
CacheStore
backed by Cassandra database.Constructor and Description |
---|
CassandraCacheStore(DataSource dataSrc,
KeyValuePersistenceSettings settings,
int maxPoolSize)
Store constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
delete(Object key) |
void |
deleteAll(Collection<?> keys) |
V |
load(K key) |
Map<K,V> |
loadAll(Iterable<? extends K> keys) |
void |
loadCache(IgniteBiInClosure<K,V> clo,
Object... args)
Loads all values from underlying persistent storage.
|
void |
sessionEnd(boolean commit)
Tells store to commit or rollback a transaction depending on the value of the
'commit'
parameter. |
String |
toString() |
void |
write(javax.cache.Cache.Entry<? extends K,? extends V> entry) |
void |
writeAll(Collection<javax.cache.Cache.Entry<? extends K,? extends V>> entries) |
public CassandraCacheStore(DataSource dataSrc, KeyValuePersistenceSettings settings, int maxPoolSize)
dataSrc
- Data source.settings
- Persistence settings for Ignite key and value objects.maxPoolSize
- Max workers thread count.public void loadCache(IgniteBiInClosure<K,V> clo, Object... args) throws javax.cache.integration.CacheLoaderException
IgniteCache.loadCache(IgniteBiPredicate, Object...)
method is invoked which is usually to preload the cache from persistent storage.
This method is optional, and cache implementation does not depend on this
method to do anything. Default implementation of this method in
CacheStoreAdapter
does nothing.
For every loaded value method IgniteBiInClosure.apply(Object, Object)
should be called on the passed in closure. The closure will then make sure
that the loaded value is stored in cache.
loadCache
in interface CacheStore<K,V>
clo
- Closure for loaded values.args
- Arguments passes into
IgniteCache.loadCache(IgniteBiPredicate, Object...)
method.javax.cache.integration.CacheLoaderException
- If loading failed.public void sessionEnd(boolean commit) throws javax.cache.integration.CacheWriterException
'commit'
parameter.sessionEnd
in interface CacheStore<K,V>
commit
- True
if transaction should commit, false
for rollback.javax.cache.integration.CacheWriterException
- If commit or rollback failed. Note that commit failure in some cases
may bring cache transaction into TransactionState.UNKNOWN
which will
consequently cause all transacted entries to be invalidated.public Map<K,V> loadAll(Iterable<? extends K> keys) throws javax.cache.integration.CacheLoaderException
public void write(javax.cache.Cache.Entry<? extends K,? extends V> entry) throws javax.cache.integration.CacheWriterException
public void writeAll(Collection<javax.cache.Cache.Entry<? extends K,? extends V>> entries) throws javax.cache.integration.CacheWriterException
public void delete(Object key) throws javax.cache.integration.CacheWriterException
public void deleteAll(Collection<?> keys) throws javax.cache.integration.CacheWriterException
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024