Interface CacheStoreManager
-
- All Superinterfaces:
GridCacheManager
- All Known Implementing Classes:
CacheOsStoreManager,GridCacheStoreManagerAdapter
public interface CacheStoreManager extends GridCacheManager
Cache store manager interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanconfigured()booleanconfiguredConvertBinary()CacheStore<?,?>configuredStore()booleanconvertBinary()voidforceFlush()voidinitialize(@Nullable CacheStore<?,?> cfgStore, Map<CacheStore,ThreadLocal> sesHolders)Initialize store manager.booleanisLocal()booleanisWriteBehind()booleanisWriteThrough()booleanisWriteToStoreFromDht()@Nullable Objectload(@Nullable IgniteInternalTx tx, KeyCacheObject key)Loads data from persistent store.booleanloadAll(@Nullable IgniteInternalTx tx, Collection<? extends KeyCacheObject> keys, IgniteBiInClosure<KeyCacheObject,Object> vis)Loads data from persistent store.booleanloadCache(GridInClosure3<KeyCacheObject,Object,GridCacheVersion> vis, Object[] args)Loads data from persistent store.voidlocalStoreLoadAll(@Nullable IgniteInternalTx tx, Collection<? extends KeyCacheObject> keys, GridInClosure3<KeyCacheObject,Object,GridCacheVersion> vis)booleanput(@Nullable IgniteInternalTx tx, KeyCacheObject key, CacheObject val, GridCacheVersion ver)Puts key-value pair into storage.booleanputAll(@Nullable IgniteInternalTx tx, Map<? extends KeyCacheObject,IgniteBiTuple<? extends CacheObject,GridCacheVersion>> map)Puts key-value pair into storage.booleanremove(@Nullable IgniteInternalTx tx, KeyCacheObject key)booleanremoveAll(@Nullable IgniteInternalTx tx, Collection<? extends KeyCacheObject> keys)voidsessionEnd(IgniteInternalTx tx, boolean commit, boolean last, boolean storeSessionEnded)CacheStore<Object,Object>store()voidwriteBehindCacheStoreSessionListenerStart()Notifies cache store session listeners.voidwriteBehindSessionEnd(boolean threwEx)End session initiated by write-behind store.voidwriteBehindSessionInit()Start session initiated by write-behind store.-
Methods inherited from interface org.apache.ignite.internal.processors.cache.GridCacheManager
onDisconnected, onKernalStart, onKernalStop, printMemoryStats, start, stop
-
-
-
-
Method Detail
-
initialize
void initialize(@Nullable @Nullable CacheStore<?,?> cfgStore, Map<CacheStore,ThreadLocal> sesHolders) throws IgniteCheckedExceptionInitialize store manager.- Parameters:
cfgStore- Actual store.sesHolders- Session holders.- Throws:
IgniteCheckedException- If failed.
-
configured
boolean configured()
- Returns:
trueIf store configured.
-
store
CacheStore<Object,Object> store()
- Returns:
- Wrapped store.
-
configuredStore
CacheStore<?,?> configuredStore()
- Returns:
- Unwrapped store provided in configuration.
-
isLocal
boolean isLocal()
- Returns:
trueIf local store is configured.
-
isWriteThrough
boolean isWriteThrough()
- Returns:
Trueis write-through is enabled.
-
isWriteBehind
boolean isWriteBehind()
- Returns:
Trueis write-behind is enabled.
-
isWriteToStoreFromDht
boolean isWriteToStoreFromDht()
- Returns:
- Whether DHT transaction can write to store from DHT.
-
load
@Nullable @Nullable Object load(@Nullable @Nullable IgniteInternalTx tx, KeyCacheObject key) throws IgniteCheckedException
Loads data from persistent store.- Parameters:
tx- Cache transaction.key- Cache key.- Returns:
- Loaded value, possibly null.
- Throws:
IgniteCheckedException- If data loading failed.
-
loadAll
boolean loadAll(@Nullable @Nullable IgniteInternalTx tx, Collection<? extends KeyCacheObject> keys, IgniteBiInClosure<KeyCacheObject,Object> vis) throws IgniteCheckedExceptionLoads data from persistent store.- Parameters:
tx- Cache transaction.keys- Cache keys.vis- Closure.- Returns:
Trueif there is a persistent storage.- Throws:
IgniteCheckedException- If data loading failed.
-
localStoreLoadAll
void localStoreLoadAll(@Nullable @Nullable IgniteInternalTx tx, Collection<? extends KeyCacheObject> keys, GridInClosure3<KeyCacheObject,Object,GridCacheVersion> vis) throws IgniteCheckedException- Parameters:
tx- Cache transaction.keys- Cache keys.vis- Closure to apply for loaded elements.- Throws:
IgniteCheckedException- If data loading failed.
-
loadCache
boolean loadCache(GridInClosure3<KeyCacheObject,Object,GridCacheVersion> vis, Object[] args) throws IgniteCheckedException
Loads data from persistent store.- Parameters:
vis- Closer to cache loaded elements.args- User arguments.- Returns:
Trueif there is a persistent storage.- Throws:
IgniteCheckedException- If data loading failed.
-
put
boolean put(@Nullable @Nullable IgniteInternalTx tx, KeyCacheObject key, CacheObject val, GridCacheVersion ver) throws IgniteCheckedExceptionPuts key-value pair into storage.- Parameters:
tx- Cache transaction.key- Key.val- Value.ver- Version.- Returns:
trueIf there is a persistent storage.- Throws:
IgniteCheckedException- If storage failed.
-
putAll
boolean putAll(@Nullable @Nullable IgniteInternalTx tx, Map<? extends KeyCacheObject,IgniteBiTuple<? extends CacheObject,GridCacheVersion>> map) throws IgniteCheckedExceptionPuts key-value pair into storage.- Parameters:
tx- Cache transaction.map- Map.- Returns:
Trueif there is a persistent storage.- Throws:
IgniteCheckedException- If storage failed.
-
remove
boolean remove(@Nullable @Nullable IgniteInternalTx tx, KeyCacheObject key) throws IgniteCheckedException- Parameters:
tx- Cache transaction.key- Key.- Returns:
Trueif there is a persistent storage.- Throws:
IgniteCheckedException- If storage failed.
-
removeAll
boolean removeAll(@Nullable @Nullable IgniteInternalTx tx, Collection<? extends KeyCacheObject> keys) throws IgniteCheckedException- Parameters:
tx- Cache transaction.keys- Key.- Returns:
Trueif there is a persistent storage.- Throws:
IgniteCheckedException- If storage failed.
-
sessionEnd
void sessionEnd(IgniteInternalTx tx, boolean commit, boolean last, boolean storeSessionEnded) throws IgniteCheckedException
- Parameters:
tx- Transaction.commit- Commit.last-Trueif this is last store in transaction.storeSessionEnded-Trueif session for underlying store already ended.- Throws:
IgniteCheckedException- If failed.
-
writeBehindSessionInit
void writeBehindSessionInit() throws IgniteCheckedExceptionStart session initiated by write-behind store.- Throws:
IgniteCheckedException- If failed.
-
writeBehindCacheStoreSessionListenerStart
void writeBehindCacheStoreSessionListenerStart() throws IgniteCheckedExceptionNotifies cache store session listeners. This method is called by write-behind store in case of back-pressure mechanism is initiated. It is assumed that cache store session was started by CacheStoreManager before.- Throws:
IgniteCheckedException- If failed.
-
writeBehindSessionEnd
void writeBehindSessionEnd(boolean threwEx) throws IgniteCheckedExceptionEnd session initiated by write-behind store.- Parameters:
threwEx- If exception was thrown.- Throws:
IgniteCheckedException- If failed.
-
forceFlush
void forceFlush() throws IgniteCheckedException- Throws:
IgniteCheckedException- If failed.
-
convertBinary
boolean convertBinary()
- Returns:
- Convert-binary flag.
-
configuredConvertBinary
boolean configuredConvertBinary()
- Returns:
- Configured convert binary flag.
-
-