public class CacheStoreBalancingWrapper<K,V> extends Object implements CacheStore<K,V>
Modifier and Type | Field and Description |
---|---|
static int |
DFLT_LOAD_ALL_THRESHOLD |
Constructor and Description |
---|
CacheStoreBalancingWrapper(CacheStore<K,V> delegate) |
CacheStoreBalancingWrapper(CacheStore<K,V> delegate,
int loadAllThreshold) |
Modifier and Type | Method and Description |
---|---|
void |
delete(Object key) |
void |
deleteAll(Collection<?> keys) |
V |
load(K key) |
void |
loadAll(Collection<? extends K> keys,
IgniteBiInClosure<K,V> c) |
Map<K,V> |
loadAll(Iterable<? extends K> keys) |
int |
loadAllThreshold() |
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 static final int DFLT_LOAD_ALL_THRESHOLD
public CacheStoreBalancingWrapper(CacheStore<K,V> delegate)
delegate
- Delegate store.public CacheStoreBalancingWrapper(CacheStore<K,V> delegate, int loadAllThreshold)
delegate
- Delegate store.loadAllThreshold
- Load all threshold.public int loadAllThreshold()
public void loadCache(IgniteBiInClosure<K,V> clo, @Nullable Object... args)
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.public Map<K,V> loadAll(Iterable<? extends K> keys) throws javax.cache.integration.CacheLoaderException
public void loadAll(Collection<? extends K> keys, IgniteBiInClosure<K,V> c)
keys
- Keys to load.c
- Closure for loaded values.public void writeAll(Collection<javax.cache.Cache.Entry<? extends K,? extends V>> entries)
public void delete(Object key) throws javax.cache.integration.CacheWriterException
public void deleteAll(Collection<?> keys) throws javax.cache.integration.CacheWriterException
public void sessionEnd(boolean commit)
'commit'
parameter.sessionEnd
in interface CacheStore<K,V>
commit
- True
if transaction should commit, false
for rollback.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017