public abstract class CacheStoreAdapter<K,V> extends Object implements CacheStore<K,V>
loadAll(Iterable)
,
writeAll(Collection)
, and deleteAll(Collection)
by sequentially calling corresponding CacheLoader.load(Object)
,
CacheWriter.write(Cache.Entry)
, and CacheWriter.delete(Object)
operations. Use this adapter whenever such behaviour is acceptable. However in many cases
it maybe more preferable to take advantage of database batch update functionality, and therefore
default adapter implementation may not be the best option.
Note that method loadCache(IgniteBiInClosure, Object...)
has empty
implementation because it is essentially up to the user to invoke it with
specific arguments.
Constructor and Description |
---|
CacheStoreAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
deleteAll(Collection<?> keys) |
Map<K,V> |
loadAll(Iterable<? extends K> keys) |
void |
loadCache(IgniteBiInClosure<K,V> clo,
Object... args)
Default empty implementation.
|
void |
sessionEnd(boolean commit)
Default empty implementation for ending transactions.
|
String |
toString() |
void |
writeAll(Collection<javax.cache.Cache.Entry<? extends K,? extends V>> entries) |
public void loadCache(IgniteBiInClosure<K,V> clo, Object... args)
IgniteCache.loadCache(IgniteBiPredicate, Object...)
method
is explicitly called.loadCache
in interface CacheStore<K,V>
clo
- Closure for loaded values.args
- Arguments passes into
IgniteCache.loadCache(IgniteBiPredicate, Object...)
method.public void writeAll(Collection<javax.cache.Cache.Entry<? extends K,? extends V>> entries)
public void deleteAll(Collection<?> keys)
public void sessionEnd(boolean commit)
sessionEnd
in interface CacheStore<K,V>
commit
- True
if transaction should commit, false
for rollback.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024