Package org.apache.ignite.cache.store
Class CacheStoreAdapter<K,V>
- java.lang.Object
- 
- org.apache.ignite.cache.store.CacheStoreAdapter<K,V>
 
- 
- All Implemented Interfaces:
- javax.cache.integration.CacheLoader<K,V>,- javax.cache.integration.CacheWriter<K,V>,- CacheStore<K,V>
 - Direct Known Subclasses:
- CacheJdbcBlobStore
 
 public abstract class CacheStoreAdapter<K,V> extends Object implements CacheStore<K,V> Cache storage convenience adapter. It provides default implementation for bulk operations, such asloadAll(Iterable),writeAll(Collection), anddeleteAll(Collection)by sequentially calling correspondingCacheLoader.load(Object),CacheWriter.write(Cache.Entry), andCacheWriter.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 SummaryConstructors Constructor Description CacheStoreAdapter()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteAll(Collection<?> keys)Map<K,V>loadAll(Iterable<? extends K> keys)voidloadCache(IgniteBiInClosure<K,V> clo, Object... args)Default empty implementation.voidsessionEnd(boolean commit)Default empty implementation for ending transactions.StringtoString()voidwriteAll(Collection<javax.cache.Cache.Entry<? extends K,? extends V>> entries)
 
- 
- 
- 
Method Detail- 
loadCachepublic void loadCache(IgniteBiInClosure<K,V> clo, Object... args) Default empty implementation. This method needs to be overridden only ifIgniteCache.loadCache(IgniteBiPredicate, Object...)method is explicitly called.- Specified by:
- loadCachein interface- CacheStore<K,V>
- Parameters:
- clo- Closure for loaded values.
- args- Arguments passes into- IgniteCache.loadCache(IgniteBiPredicate, Object...)method.
 
 - 
writeAllpublic void writeAll(Collection<javax.cache.Cache.Entry<? extends K,? extends V>> entries) 
 - 
deleteAllpublic void deleteAll(Collection<?> keys) 
 - 
sessionEndpublic void sessionEnd(boolean commit) Default empty implementation for ending transactions. Note that if explicit cache transactions are not used, then transactions do not have to be explicitly ended - for all other cases this method should be overridden with custom commit/rollback logic.- Specified by:
- sessionEndin interface- CacheStore<K,V>
- Parameters:
- commit-- Trueif transaction should commit,- falsefor rollback.
 
 
- 
 
-