org.apache.ignite.internal.processors.cache

## Class GridCacheStoreManager<K,V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter<K,V>
  - - org.apache.ignite.internal.processors.cache.GridCacheStoreManager<K,V>

All Implemented Interfaces:
  GridCacheManager<K,V>

    public class GridCacheStoreManager<K,V>
    extends GridCacheManagerAdapter<K,V>

Store manager.

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter

`cctx, log`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheStoreManager(GridKernalContext ctx, Map<CacheStore,ThreadLocal> sesHolders, CacheStore<K,Object> cfgStore, CacheConfiguration cfg)`

### Method Summary

Methods
`boolean` `configured()`
`CacheStore<?,?>` `configuredStore()`
`boolean` `convertPortable()`
`void` `convertPortable(boolean convertPortable)`
`void` `forceFlush()`
`boolean` `isLocalStore()`
`boolean` `loadAllFromStore(IgniteInternalTx tx, Collection<? extends K> keys, IgniteBiInClosure<K,V> vis)` Loads data from persistent store.
`boolean` `loadCache(GridInClosure3<K,V,GridCacheVersion> vis, Object[] args)` Loads data from persistent store.
`V` `loadFromStore(IgniteInternalTx tx, K key)` Loads data from persistent store.
`void` `localStoreLoadAll(IgniteInternalTx tx, Collection<? extends K> keys, GridInClosure3<K,V,GridCacheVersion> vis)`
`boolean` `putAllToStore(IgniteInternalTx tx, Map<K,IgniteBiTuple<V,GridCacheVersion>> map)` Puts key-value pair into storage.
`boolean` `putToStore(IgniteInternalTx tx, K key, V val, GridCacheVersion ver)` Puts key-value pair into storage.
`boolean` `removeAllFromStore(IgniteInternalTx tx, Collection<?> keys)`
`boolean` `removeFromStore(IgniteInternalTx tx, K key)`
`protected void` `start0()`
`protected void` `stop0(boolean cancel)`
`CacheStore<K,Object>` `store()`
`void` `txEnd(IgniteInternalTx tx, boolean commit)`
`boolean` `writeThrough()`
`boolean` `writeToStoreFromDht()`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter

`context, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStart0, onKernalStop, onKernalStop0, printMemoryStats, start, startInfo, stop, stopInfo, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### GridCacheStoreManager

    public GridCacheStoreManager(GridKernalContext ctx,
                         Map<CacheStore,ThreadLocal> sesHolders,
                         @Nullable
                         CacheStore<K,Object> cfgStore,
                         CacheConfiguration cfg)
                          throws IgniteCheckedException

Parameters:
  `ctx` - Kernal context.
  `sesHolders` - Session holders map to use the same session holder for different managers if they use the same store instance.
  `cfgStore` - Store provided in configuration.
  `cfg` - Cache configuration.
Throws:
  `IgniteCheckedException` - In case of error.

### Method Detail

#### writeThrough

    public boolean writeThrough()

Returns:
  `True` is write-through is enabled.

#### configuredStore

    public CacheStore<?,?> configuredStore()

Returns:
  Unwrapped store provided in configuration.

#### start0

    protected void start0()
                   throws IgniteCheckedException

Overrides:
  `start0` in class `GridCacheManagerAdapter<K,V>`
Throws:
  `IgniteCheckedException` - If failed.

#### stop0

    protected void stop0(boolean cancel)

Overrides:
  `stop0` in class `GridCacheManagerAdapter<K,V>`
Parameters:
  `cancel` - Cancel flag.

#### convertPortable

    public boolean convertPortable()

Returns:
  Convert-portable flag.

#### convertPortable

    public void convertPortable(boolean convertPortable)

Parameters:
  `convertPortable` - Convert-portable flag.

#### isLocalStore

    public boolean isLocalStore()

Returns:
  `true` If local store is configured.

#### configured

    public boolean configured()

Returns:
  `true` If store configured.

#### loadFromStore

    @Nullable
    public V loadFromStore(@Nullable
                           IgniteInternalTx tx,
                           K 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.

#### writeToStoreFromDht

    public boolean writeToStoreFromDht()

Returns:
  Whether DHT transaction can write to store from DHT.

#### localStoreLoadAll

    public void localStoreLoadAll(@Nullable
                         IgniteInternalTx tx,
                         Collection<? extends K> keys,
                         GridInClosure3<K,V,GridCacheVersion> vis)
                           throws IgniteCheckedException

Parameters:
  `tx` - Cache transaction.
  `keys` - Cache keys.
  `vis` - Closure to apply for loaded elements.
Throws:
  `IgniteCheckedException` - If data loading failed.

#### loadAllFromStore

    public boolean loadAllFromStore(@Nullable
                           IgniteInternalTx tx,
                           Collection<? extends K> keys,
                           IgniteBiInClosure<K,V> vis)
                             throws IgniteCheckedException

Loads data from persistent store.

Parameters:
  `tx` - Cache transaction.
  `keys` - Cache keys.
  `vis` - Closure.
Returns:
  `True` if there is a persistent storage.
Throws:
  `IgniteCheckedException` - If data loading failed.

#### loadCache

    public boolean loadCache(GridInClosure3<K,V,GridCacheVersion> vis,
                    Object[] args)
                      throws IgniteCheckedException

Loads data from persistent store.

Parameters:
  `vis` - Closer to cache loaded elements.
  `args` - User arguments.
Returns:
  `True` if there is a persistent storage.
Throws:
  `IgniteCheckedException` - If data loading failed.

#### putToStore

    public boolean putToStore(@Nullable
                     IgniteInternalTx tx,
                     K key,
                     V val,
                     GridCacheVersion ver)
                       throws IgniteCheckedException

Puts key-value pair into storage.

Parameters:
  `tx` - Cache transaction.
  `key` - Key.
  `val` - Value.
  `ver` - Version.
Returns:
  `true` If there is a persistent storage.
Throws:
  `IgniteCheckedException` - If storage failed.

#### putAllToStore

    public boolean putAllToStore(@Nullable
                        IgniteInternalTx tx,
                        Map<K,IgniteBiTuple<V,GridCacheVersion>> map)
                          throws IgniteCheckedException

Puts key-value pair into storage.

Parameters:
  `tx` - Cache transaction.
  `map` - Map.
Returns:
  `True` if there is a persistent storage.
Throws:
  `IgniteCheckedException` - If storage failed.

#### removeFromStore

    public boolean removeFromStore(@Nullable
                          IgniteInternalTx tx,
                          K key)
                            throws IgniteCheckedException

Parameters:
  `tx` - Cache transaction.
  `key` - Key.
Returns:
  `True` if there is a persistent storage.
Throws:
  `IgniteCheckedException` - If storage failed.

#### removeAllFromStore

    public boolean removeAllFromStore(@Nullable
                             IgniteInternalTx tx,
                             Collection<?> keys)
                               throws IgniteCheckedException

Parameters:
  `tx` - Cache transaction.
  `keys` - Key.
Returns:
  `True` if there is a persistent storage.
Throws:
  `IgniteCheckedException` - If storage failed.

#### store

    public CacheStore<K,Object> store()

Returns:
  Store.

#### forceFlush

    public void forceFlush()
                    throws IgniteCheckedException

Throws:
  `IgniteCheckedException` - If failed.

#### txEnd

    public void txEnd(IgniteInternalTx tx,
             boolean commit)
               throws IgniteCheckedException

Parameters:
  `tx` - Transaction.
  `commit` - Commit.
Throws:
  `IgniteCheckedException` - If failed.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015