org.apache.ignite.internal.processors.cache

## Interface IgniteCacheOffheapManager

All Known Implementing Classes:
  GridCacheOffheapManager, IgniteCacheOffheapManagerImpl

    public interface IgniteCacheOffheapManager

### Nested Class Summary

Nested Classes
`static interface` `IgniteCacheOffheapManager.CacheDataStore`
`static interface` `IgniteCacheOffheapManager.OffheapInvokeClosure`

### Method Summary

All Methods Instance Methods Abstract Methods
`Iterable<IgniteCacheOffheapManager.CacheDataStore>` `cacheDataStores()`
`long` `cacheEntriesCount(int cacheId)`
`long` `cacheEntriesCount(int cacheId, boolean primary, boolean backup, AffinityTopologyVersion topVer)`
`long` `cacheEntriesCount(int cacheId, int part)`
`<K,V> GridCloseableIterator<javax.cache.Cache.Entry<K,V>>` `cacheEntriesIterator(GridCacheContext cctx, boolean primary, boolean backup, AffinityTopologyVersion topVer, boolean keepBinary)`
`GridIterator<CacheDataRow>` `cacheIterator(int cacheId, boolean primary, boolean backup, AffinityTopologyVersion topVer)`
`GridCloseableIterator<KeyCacheObject>` `cacheKeysIterator(int cacheId, int part)`
`GridIterator<CacheDataRow>` `cachePartitionIterator(int cacheId, int part)`
`void` `clearCache(GridCacheContext cctx, boolean readers)` Clears offheap entries.
`boolean` `containsKey(GridCacheMapEntry entry)` TODO: GG-10884, used on only from initialValue.
`IgniteCacheOffheapManager.CacheDataStore` `createCacheDataStore(int p)`
`IgniteCacheOffheapManager.CacheDataStore` `dataStore(GridDhtLocalPartition part)`
`void` `destroyCacheDataStore(IgniteCacheOffheapManager.CacheDataStore store)`
`void` `dropRootPageForIndex(int cacheId, String idxName)`
`boolean` `expire(GridCacheContext cctx, IgniteInClosure2X<GridCacheEntryEx,GridCacheVersion> c, int amount)`
`long` `expiredSize()` Gets the number of entries pending expire.
`GridAtomicLong` `globalRemoveId()`
`void` `invoke(GridCacheContext cctx, KeyCacheObject key, GridDhtLocalPartition part, IgniteCacheOffheapManager.OffheapInvokeClosure c)`
`long` `lastUpdatedPartitionCounter(int part)` Partition counter provider.
`long` `offHeapAllocatedSize()`
`void` `onCacheStarted(GridCacheContext cctx)`
`void` `onKernalStop()`
`void` `onPartitionCounterUpdated(int part, long cntr)` Partition counter update callback.
`void` `onPartitionInitialCounterUpdated(int part, long cntr)` Initial counter will be updated on state restore only
`int` `onUndeploy(ClassLoader ldr)`
`GridIterator<CacheDataRow>` `partitionIterator(int part)`
`CacheDataRow` `read(GridCacheContext cctx, KeyCacheObject key)`
`CacheDataRow` `read(GridCacheMapEntry entry)`
`IgniteRebalanceIterator` `rebalanceIterator(int part, AffinityTopologyVersion topVer, Long partCntr)`
`void` `remove(GridCacheContext cctx, KeyCacheObject key, int partId, GridDhtLocalPartition part)`
`ReuseList` `reuseListForIndex(String idxName)`
`RootPage` `rootPageForIndex(int cacheId, String idxName)`
`void` `start(GridCacheSharedContext ctx, CacheGroupContext grp)`
`void` `stop()`
`void` `stopCache(int cacheId, boolean destroy)`
`int` `totalPartitionEntriesCount(int part)`
`void` `update(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, GridDhtLocalPartition part, CacheDataRow oldRow)`

### Method Detail

#### start

    void start(GridCacheSharedContext ctx,
               CacheGroupContext grp)
        throws IgniteCheckedException

Parameters:
  `ctx` - Context.
  `grp` - Cache group.
Throws:
  `IgniteCheckedException` - If failed.

#### onCacheStarted

    void onCacheStarted(GridCacheContext cctx)
                 throws IgniteCheckedException

Parameters:
  `cctx` - Cache context.
Throws:
  `IgniteCheckedException` - If failed.

#### onKernalStop

    void onKernalStop()

#### stopCache

    void stopCache(int cacheId,
                   boolean destroy)

Parameters:
  `cacheId` - Cache ID.
  `destroy` - Destroy data flag. Setting to `true` will remove all cache data.

#### stop

    void stop()

#### onPartitionCounterUpdated

    void onPartitionCounterUpdated(int part,
                                   long cntr)

Partition counter update callback. May be overridden by plugin-provided subclasses.

Parameters:
  `part` - Partition.
  `cntr` - Partition counter.

#### onPartitionInitialCounterUpdated

    void onPartitionInitialCounterUpdated(int part,
                                          long cntr)

Initial counter will be updated on state restore only

Parameters:
  `part` - Partition
  `cntr` - New initial counter

#### lastUpdatedPartitionCounter

    long lastUpdatedPartitionCounter(int part)

Partition counter provider. May be overridden by plugin-provided subclasses.

Parameters:
  `part` - Partition ID.
Returns:
  Last updated counter.

#### read

    @Nullable
    CacheDataRow read(GridCacheMapEntry entry)
                         throws IgniteCheckedException

Parameters:
  `entry` - Cache entry.
Returns:
  Cached row, if available, null otherwise.
Throws:
  `IgniteCheckedException` - If failed.

#### read

    @Nullable
    CacheDataRow read(GridCacheContext cctx,
                                KeyCacheObject key)
                         throws IgniteCheckedException

Parameters:
  `cctx` - Cache context.
  `key` - Key.
Returns:
  Cached row, if available, null otherwise.
Throws:
  `IgniteCheckedException` - If failed.

#### createCacheDataStore

    IgniteCacheOffheapManager.CacheDataStore createCacheDataStore(int p)
                                                           throws IgniteCheckedException

Parameters:
  `p` - Partition.
Returns:
  Data store.
Throws:
  `IgniteCheckedException` - If failed.

#### cacheDataStores

    Iterable<IgniteCacheOffheapManager.CacheDataStore> cacheDataStores()

Returns:
  Iterable over all existing cache data stores.

#### dataStore

    IgniteCacheOffheapManager.CacheDataStore dataStore(GridDhtLocalPartition part)

Parameters:
  `part` - Partition.
Returns:
  Data store.

#### destroyCacheDataStore

    void destroyCacheDataStore(IgniteCacheOffheapManager.CacheDataStore store)
                        throws IgniteCheckedException

Parameters:
  `store` - Data store.
Throws:
  `IgniteCheckedException` - If failed.

#### containsKey

    boolean containsKey(GridCacheMapEntry entry)

TODO: GG-10884, used on only from initialValue.

#### expire

    boolean expire(GridCacheContext cctx,
                   IgniteInClosure2X<GridCacheEntryEx,GridCacheVersion> c,
                   int amount)
            throws IgniteCheckedException

Parameters:
  `cctx` - Cache context.
  `c` - Closure.
Throws:
  `IgniteCheckedException` - If failed.

#### expiredSize

    long expiredSize()
              throws IgniteCheckedException

Gets the number of entries pending expire.

Returns:
  Number of pending entries.
Throws:
  `IgniteCheckedException` - If failed to get number of pending entries.

#### invoke

    void invoke(GridCacheContext cctx,
                KeyCacheObject key,
                GridDhtLocalPartition part,
                IgniteCacheOffheapManager.OffheapInvokeClosure c)
         throws IgniteCheckedException

Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `part` - Partition.
  `c` - Tree update closure.
Throws:
  `IgniteCheckedException` - If failed.

#### update

    void update(GridCacheContext cctx,
                KeyCacheObject key,
                CacheObject val,
                GridCacheVersion ver,
                long expireTime,
                GridDhtLocalPartition part,
                @Nullable
                CacheDataRow oldRow)
         throws IgniteCheckedException

Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `val` - Value.
  `ver` - Version.
  `expireTime` - Expire time.
  `oldRow` - Old row if available.
  `part` - Partition.
Throws:
  `IgniteCheckedException` - If failed.

#### remove

    void remove(GridCacheContext cctx,
                KeyCacheObject key,
                int partId,
                GridDhtLocalPartition part)
         throws IgniteCheckedException

Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `partId` - Partition number.
  `part` - Partition.
Throws:
  `IgniteCheckedException` - If failed.

#### onUndeploy

    int onUndeploy(ClassLoader ldr)

Parameters:
  `ldr` - Class loader.
Returns:
  Number of undeployed entries.

#### cacheIterator

    GridIterator<CacheDataRow> cacheIterator(int cacheId,
                                             boolean primary,
                                             boolean backup,
                                             AffinityTopologyVersion topVer)
                                      throws IgniteCheckedException

Parameters:
  `cacheId` - Cache ID.
  `primary` - Primary entries flag.
  `backup` - Backup entries flag.
  `topVer` - Topology version.
Returns:
  Rows iterator.
Throws:
  `IgniteCheckedException` - If failed.

#### cachePartitionIterator

    GridIterator<CacheDataRow> cachePartitionIterator(int cacheId,
                                                      int part)
                                               throws IgniteCheckedException

Parameters:
  `cacheId` - Cache ID.
  `part` - Partition.
Returns:
  Partition data iterator.
Throws:
  `IgniteCheckedException` - If failed.

#### partitionIterator

    GridIterator<CacheDataRow> partitionIterator(int part)
                                          throws IgniteCheckedException

Parameters:
  `part` - Partition number.
Returns:
  Iterator for given partition.
Throws:
  `IgniteCheckedException` - If failed.

#### rebalanceIterator

    IgniteRebalanceIterator rebalanceIterator(int part,
                                              AffinityTopologyVersion topVer,
                                              Long partCntr)
                                       throws IgniteCheckedException

Parameters:
  `part` - Partition.
  `topVer` - Topology version.
  `partCntr` - Partition counter to get historical data if available.
Returns:
  Partition data iterator.
Throws:
  `IgniteCheckedException` - If failed.

#### cacheEntriesIterator

    <K,V> GridCloseableIterator<javax.cache.Cache.Entry<K,V>> cacheEntriesIterator(GridCacheContext cctx,
                                                                                   boolean primary,
                                                                                   boolean backup,
                                                                                   AffinityTopologyVersion topVer,
                                                                                   boolean keepBinary)
                                                                            throws IgniteCheckedException

Parameters:
  `cctx` - Cache context.
  `primary` - Primary entries flag.
  `backup` - Backup entries flag.
  `topVer` - Topology version.
  `keepBinary` - Keep binary flag.
Returns:
  Entries iterator.
Throws:
  `IgniteCheckedException` - If failed.

#### cacheKeysIterator

    GridCloseableIterator<KeyCacheObject> cacheKeysIterator(int cacheId,
                                                            int part)
                                                     throws IgniteCheckedException

Parameters:
  `cacheId` - Cache ID.
  `part` - Partition.
Returns:
  Iterator.
Throws:
  `IgniteCheckedException` - If failed.

#### cacheEntriesCount

    long cacheEntriesCount(int cacheId,
                           boolean primary,
                           boolean backup,
                           AffinityTopologyVersion topVer)
                    throws IgniteCheckedException

Parameters:
  `cacheId` - Cache ID.
  `primary` - Primary entries flag.
  `backup` - Backup entries flag.
  `topVer` - Topology version.
Returns:
  Entries count.
Throws:
  `IgniteCheckedException` - If failed.

#### clearCache

    void clearCache(GridCacheContext cctx,
                    boolean readers)

Clears offheap entries.

Parameters:
  `cctx` - Cache context.
  `readers` - `True` to clear readers.

#### cacheEntriesCount

    long cacheEntriesCount(int cacheId,
                           int part)

Parameters:
  `cacheId` - Cache ID.
  `part` - Partition.
Returns:
  Number of entries in given partition.

#### offHeapAllocatedSize

    long offHeapAllocatedSize()

Returns:
  Offheap allocated size.

#### globalRemoveId

    GridAtomicLong globalRemoveId()

Returns:
  Global remove ID counter.

#### rootPageForIndex

    RootPage rootPageForIndex(int cacheId,
                              String idxName)
                       throws IgniteCheckedException

Parameters:
  `cacheId` - Cache ID.
  `idxName` - Index name.
Returns:
  Root page for index tree.
Throws:
  `IgniteCheckedException` - If failed.

#### dropRootPageForIndex

    void dropRootPageForIndex(int cacheId,
                              String idxName)
                       throws IgniteCheckedException

Parameters:
  `cacheId` - Cache ID.
  `idxName` - Index name.
Throws:
  `IgniteCheckedException` - If failed.

#### reuseListForIndex

    ReuseList reuseListForIndex(String idxName)
                         throws IgniteCheckedException

Parameters:
  `idxName` - Index name.
Returns:
  Reuse list for index tree.
Throws:
  `IgniteCheckedException` - If failed.

#### cacheEntriesCount

    long cacheEntriesCount(int cacheId)

Parameters:
  `cacheId` - Cache ID.
Returns:
  Number of entries.

#### totalPartitionEntriesCount

    int totalPartitionEntriesCount(int part)

Parameters:
  `part` - Partition.
Returns:
  Number of entries.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.4.0
Release Date | : March 5 2018