org.apache.ignite.internal.processors.cache

## Class IgniteCacheOffheapManagerImpl

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl

All Implemented Interfaces:
  IgniteCacheOffheapManager

Direct Known Subclasses:
  GridCacheOffheapManager

    public class IgniteCacheOffheapManagerImpl
    extends Object
    implements IgniteCacheOffheapManager

### Nested Class Summary

Nested Classes
`protected class` `IgniteCacheOffheapManagerImpl.CacheDataStoreImpl`

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManager

`IgniteCacheOffheapManager.CacheDataStore, IgniteCacheOffheapManager.OffheapInvokeClosure`

### Field Summary

Fields
`protected GridSpinBusyLock` `busyLock`
`protected GridCacheSharedContext` `ctx`
`protected CacheGroupContext` `grp`
`protected IgniteLogger` `log`
`protected ConcurrentMap<Integer,IgniteCacheOffheapManager.CacheDataStore>` `partDataStores`
`protected GridStripedLock` `partStoreLock`
`static int` `PRELOAD_SIZE_UNDER_CHECKPOINT_LOCK` The maximum number of entries that can be preloaded under checkpoint read lock.

### Constructor Summary

Constructors
Constructor and Description
`IgniteCacheOffheapManagerImpl()`

### Method Summary

All Methods Instance Methods Concrete 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, @Nullable MvccSnapshot mvccSnapshot, Boolean dataPageScanEnabled)`
`GridIterator<CacheDataRow>` `cacheIterator(int cacheId, boolean primary, boolean backups, AffinityTopologyVersion topVer, @Nullable MvccSnapshot mvccSnapshot, Boolean dataPageScanEnabled)`
`GridCloseableIterator<KeyCacheObject>` `cacheKeysIterator(int cacheId, int part)`
`GridIterator<CacheDataRow>` `cachePartitionIterator(int cacheId, int part, @Nullable MvccSnapshot mvccSnapshot, Boolean dataPageScanEnabled)`
`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)`
`protected IgniteCacheOffheapManager.CacheDataStore` `createCacheDataStore0(int p)`
`IgniteCacheOffheapManager.CacheDataStore` `dataStore(GridDhtLocalPartition part)`
`IgniteCacheOffheapManager.CacheDataStore` `dataStore(int part)`
`void` `destroyCacheDataStore(IgniteCacheOffheapManager.CacheDataStore store)`
`protected void` `destroyCacheDataStore0(IgniteCacheOffheapManager.CacheDataStore store)`
`void` `dropRootPageForIndex(int cacheId, String idxName, int segment)`
`boolean` `expire(GridCacheContext cctx, IgniteInClosure2X<GridCacheEntryEx,GridCacheVersion> c, int amount)`
`long` `expiredSize()` Gets the number of entries pending expire.
`GridAtomicLong` `globalRemoveId()`
`protected @Nullable IgniteHistoricalIterator` `historicalIterator(CachePartitionPartialCountersMap partCntrs, Set<Integer> missing)`
`protected void` `initDataStructures()`
`protected void` `initPendingTree(GridCacheContext cctx)`
`void` `invoke(GridCacheContext cctx, KeyCacheObject key, GridDhtLocalPartition part, IgniteCacheOffheapManager.OffheapInvokeClosure c)`
`long` `lastUpdatedPartitionCounter(int part)` Partition counter provider.
`List<IgniteBiTuple<Object,MvccVersion>>` `mvccAllVersions(GridCacheContext cctx, KeyCacheObject key)` For testing only.
`GridCursor<CacheDataRow>` `mvccAllVersionsCursor(GridCacheContext cctx, KeyCacheObject key, Object x)` Returns iterator over the all row versions for the given key.
`boolean` `mvccApplyHistoryIfAbsent(GridCacheMapEntry entry, List<GridCacheMvccEntryInfo> hist)` Tries to apply entry history.
`void` `mvccApplyUpdate(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, GridDhtLocalPartition part, MvccVersion mvccVer)`
`boolean` `mvccInitialValue(GridCacheMapEntry entry, CacheObject val, GridCacheVersion ver, long expireTime, MvccVersion mvccVer, MvccVersion newMvccVer)`
`@Nullable MvccUpdateResult` `mvccLock(GridCacheMapEntry entry, MvccSnapshot mvccSnapshot)`
`@Nullable CacheDataRow` `mvccRead(GridCacheContext cctx, KeyCacheObject key, MvccSnapshot mvccSnapshot)`
`MvccUpdateResult` `mvccRemove(GridCacheMapEntry entry, MvccSnapshot mvccSnapshot, boolean primary, boolean needHistory, boolean needOldVal, @Nullable CacheEntryPredicate filter, boolean retVal)`
`void` `mvccRemoveAll(GridCacheMapEntry entry)`
`MvccUpdateResult` `mvccUpdate(GridCacheMapEntry entry, CacheObject val, GridCacheVersion ver, long expireTime, MvccSnapshot mvccSnapshot, boolean primary, boolean needHistory, boolean noCreate, boolean needOldVal, @Nullable CacheEntryPredicate filter, boolean retVal, boolean keepBinary, javax.cache.processor.EntryProcessor entryProc, Object[] invokeArgs)`
`boolean` `mvccUpdateRowWithPreloadInfo(GridCacheMapEntry entry, @Nullable CacheObject val, GridCacheVersion ver, long expireTime, MvccVersion mvccVer, MvccVersion newMvccVer, byte mvccTxState, byte newMvccTxState)` Apply update with full history.
`long` `offHeapAllocatedSize()`
`void` `onCacheStarted(GridCacheContext cctx)`
`void` `onKernalStop()`
`void` `onPartitionCounterUpdated(int part, long cntr)` Partition counter update callback.
`void` `onPartitionInitialCounterUpdated(int part, long start, long delta)` Initial counter will be updated on state restore only
`int` `onUndeploy(ClassLoader ldr)`
`GridIterator<CacheDataRow>` `partitionIterator(int part)`
`void` `preloadPartition(int p)` Preload a partition.
`@Nullable CacheDataRow` `read(GridCacheContext cctx, KeyCacheObject key)`
`@Nullable CacheDataRow` `read(GridCacheMapEntry entry)`
`IgniteRebalanceIterator` `rebalanceIterator(IgniteDhtDemandedPartitionsMap parts, AffinityTopologyVersion topVer)`
`void` `remove(GridCacheContext cctx, KeyCacheObject key, int partId, GridDhtLocalPartition part)`
`GridCloseableIterator<CacheDataRow>` `reservedIterator(int part, AffinityTopologyVersion topVer)`
`long` `restorePartitionStates(Map<GroupPartitionId,Integer> partitionRecoveryStates)` Pre-create partitions that resides in page memory or WAL and restores their state.
`ReuseList` `reuseListForIndex(String idxName)`
`RootPage` `rootPageForIndex(int cacheId, String idxName, int segment)`
`void` `start(GridCacheSharedContext ctx, CacheGroupContext grp)`
`void` `stop()`
`void` `stopCache(int cacheId, boolean destroy)`
`void` `storeEntries(int partId, Iterator<GridCacheEntryInfo> infos, IgnitePredicateX<CacheDataRow> initPred)` Store entries.
`long` `totalPartitionEntriesCount(int p)`
`protected String` `treeName(int p)`
`void` `update(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, GridDhtLocalPartition part, @Nullable CacheDataRow oldRow)`

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

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

### Field Detail

#### PRELOAD_SIZE_UNDER_CHECKPOINT_LOCK

    public static final int PRELOAD_SIZE_UNDER_CHECKPOINT_LOCK

The maximum number of entries that can be preloaded under checkpoint read lock.

See Also:
  Constant Field Values

#### ctx

    protected GridCacheSharedContext ctx

#### grp

    protected CacheGroupContext grp

#### log

    protected IgniteLogger log

#### partDataStores

    protected final ConcurrentMap<Integer,IgniteCacheOffheapManager.CacheDataStore> partDataStores

#### busyLock

    protected final GridSpinBusyLock busyLock

#### partStoreLock

    protected GridStripedLock partStoreLock

### Constructor Detail

#### IgniteCacheOffheapManagerImpl

    public IgniteCacheOffheapManagerImpl()

### Method Detail

#### globalRemoveId

    public GridAtomicLong globalRemoveId()

Specified by:
  `globalRemoveId` in interface `IgniteCacheOffheapManager`
Returns:
  Global remove ID counter.

#### start

    public void start(GridCacheSharedContext ctx,
                      CacheGroupContext grp)
               throws IgniteCheckedException

Specified by:
  `start` in interface `IgniteCacheOffheapManager`
Parameters:
  `ctx` - Context.
  `grp` - Cache group.
Throws:
  `IgniteCheckedException` - If failed.

#### onCacheStarted

    public void onCacheStarted(GridCacheContext cctx)
                        throws IgniteCheckedException

Specified by:
  `onCacheStarted` in interface `IgniteCacheOffheapManager`
Parameters:
  `cctx` - Cache context.
Throws:
  `IgniteCheckedException` - If failed.

#### initPendingTree

    protected void initPendingTree(GridCacheContext cctx)
                            throws IgniteCheckedException

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

#### initDataStructures

    protected void initDataStructures()
                               throws IgniteCheckedException

Throws:
  `IgniteCheckedException` - If failed.

#### stopCache

    public void stopCache(int cacheId,
                          boolean destroy)

Specified by:
  `stopCache` in interface `IgniteCacheOffheapManager`
Parameters:
  `cacheId` - Cache ID.
  `destroy` - Destroy data flag. Setting to `true` will remove all cache data.

#### stop

    public void stop()

Specified by:
  `stop` in interface `IgniteCacheOffheapManager`

#### restorePartitionStates

    public long restorePartitionStates(Map<GroupPartitionId,Integer> partitionRecoveryStates)
                                throws IgniteCheckedException

Pre-create partitions that resides in page memory or WAL and restores their state.

Specified by:
  `restorePartitionStates` in interface `IgniteCacheOffheapManager`
Parameters:
  `partitionRecoveryStates` - Partition recovery states.
Returns:
  Number of processed partitions.
Throws:
  `IgniteCheckedException` - If failed.

#### onKernalStop

    public void onKernalStop()

Specified by:
  `onKernalStop` in interface `IgniteCacheOffheapManager`

#### dataStore

    public IgniteCacheOffheapManager.CacheDataStore dataStore(GridDhtLocalPartition part)

Specified by:
  `dataStore` in interface `IgniteCacheOffheapManager`
Parameters:
  `part` - Partition.
Returns:
  Data store for given entry.

#### dataStore

    public IgniteCacheOffheapManager.CacheDataStore dataStore(int part)

Parameters:
  `part` - Partition.
Returns:
  Data store for given entry.

#### cacheEntriesCount

    public long cacheEntriesCount(int cacheId)

Specified by:
  `cacheEntriesCount` in interface `IgniteCacheOffheapManager`
Parameters:
  `cacheId` - Cache ID.
Returns:
  Number of entries.

#### totalPartitionEntriesCount

    public long totalPartitionEntriesCount(int p)

Specified by:
  `totalPartitionEntriesCount` in interface `IgniteCacheOffheapManager`
Parameters:
  `p` - Partition.
Returns:
  Number of entries.

#### preloadPartition

    public void preloadPartition(int p)
                          throws IgniteCheckedException

Preload a partition. Must be called under partition reservation for DHT caches.

Specified by:
  `preloadPartition` in interface `IgniteCacheOffheapManager`
Parameters:
  `p` - Partition.
Throws:
  `IgniteCheckedException` - If failed.

#### cacheEntriesCount

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

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

#### cacheEntriesCount

    public long cacheEntriesCount(int cacheId,
                                  int part)

Specified by:
  `cacheEntriesCount` in interface `IgniteCacheOffheapManager`
Parameters:
  `cacheId` - Cache ID.
  `part` - Partition.
Returns:
  Number of entries in given partition.

#### invoke

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

Specified by:
  `invoke` in interface `IgniteCacheOffheapManager`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `part` - Partition.
  `c` - Tree update closure.
Throws:
  `IgniteCheckedException` - If failed.

#### update

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

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

#### mvccInitialValue

    public boolean mvccInitialValue(GridCacheMapEntry entry,
                                    CacheObject val,
                                    GridCacheVersion ver,
                                    long expireTime,
                                    MvccVersion mvccVer,
                                    MvccVersion newMvccVer)
                             throws IgniteCheckedException

Specified by:
  `mvccInitialValue` in interface `IgniteCacheOffheapManager`
Parameters:
  `entry` - Entry.
  `val` - Value.
  `ver` - Version.
  `expireTime` - Expire time.
  `mvccVer` - MVCC version.
  `newMvccVer` - New MVCC version.
Returns:
  `True` if value was inserted.
Throws:
  `IgniteCheckedException` - If failed.

#### mvccApplyHistoryIfAbsent

    public boolean mvccApplyHistoryIfAbsent(GridCacheMapEntry entry,
                                            List<GridCacheMvccEntryInfo> hist)
                                     throws IgniteCheckedException

Tries to apply entry history. Either applies full entry history or do nothing.

Specified by:
  `mvccApplyHistoryIfAbsent` in interface `IgniteCacheOffheapManager`
Parameters:
  `entry` - Entry to update.
  `hist` - Full entry history.
Returns:
  `True` if history applied successfully, `False` otherwise.
Throws:
  `IgniteCheckedException`

#### mvccUpdateRowWithPreloadInfo

    public boolean mvccUpdateRowWithPreloadInfo(GridCacheMapEntry entry,
                                                @Nullable
                                                @Nullable CacheObject val,
                                                GridCacheVersion ver,
                                                long expireTime,
                                                MvccVersion mvccVer,
                                                MvccVersion newMvccVer,
                                                byte mvccTxState,
                                                byte newMvccTxState)
                                         throws IgniteCheckedException

Apply update with full history. Note: History version may be skipped if it have already been actualized with previous update operation.

Specified by:
  `mvccUpdateRowWithPreloadInfo` in interface `IgniteCacheOffheapManager`
Parameters:
  `entry` - Entry.
  `val` - Value.
  `ver` - Version.
  `mvccVer` - MVCC version.
  `newMvccVer` - New MVCC version.
Returns:
  `True` if value was inserted.
Throws:
  `IgniteCheckedException` - If failed.

#### mvccUpdate

    public MvccUpdateResult mvccUpdate(GridCacheMapEntry entry,
                                       CacheObject val,
                                       GridCacheVersion ver,
                                       long expireTime,
                                       MvccSnapshot mvccSnapshot,
                                       boolean primary,
                                       boolean needHistory,
                                       boolean noCreate,
                                       boolean needOldVal,
                                       @Nullable
                                       @Nullable CacheEntryPredicate filter,
                                       boolean retVal,
                                       boolean keepBinary,
                                       javax.cache.processor.EntryProcessor entryProc,
                                       Object[] invokeArgs)
                                throws IgniteCheckedException

Specified by:
  `mvccUpdate` in interface `IgniteCacheOffheapManager`
Parameters:
  `entry` - Entry.
  `val` - Value.
  `ver` - Cache version.
  `expireTime` - Expire time.
  `mvccSnapshot` - MVCC snapshot.
  `primary` - `True` if on primary node.
  `needHistory` - Flag to collect history.
  `noCreate` - Flag indicating that row should not be created if absent.
  `needOldVal` - `True` if need old value.
  `filter` - Filter.
  `retVal` - Flag to return previous value.
  `keepBinary` - Keep binary flag.
  `entryProc` - Entry processor.
  `invokeArgs` - Entry processor invoke arguments.
Returns:
  Update result.
Throws:
  `IgniteCheckedException` - If failed.

#### mvccRemove

    public MvccUpdateResult mvccRemove(GridCacheMapEntry entry,
                                       MvccSnapshot mvccSnapshot,
                                       boolean primary,
                                       boolean needHistory,
                                       boolean needOldVal,
                                       @Nullable
                                       @Nullable CacheEntryPredicate filter,
                                       boolean retVal)
                                throws IgniteCheckedException

Specified by:
  `mvccRemove` in interface `IgniteCacheOffheapManager`
Parameters:
  `entry` - Entry.
  `mvccSnapshot` - MVCC snapshot.
  `primary` - `True` if on primary node.
  `needHistory` - Flag to collect history.
  `needOldVal` - `True` if need old value.
  `filter` - Filter.
  `retVal` - Flag to return previous value.
Returns:
  Update result.
Throws:
  `IgniteCheckedException` - If failed.

#### mvccRemoveAll

    public void mvccRemoveAll(GridCacheMapEntry entry)
                       throws IgniteCheckedException

Specified by:
  `mvccRemoveAll` in interface `IgniteCacheOffheapManager`
Parameters:
  `entry` - Entry.
Throws:
  `IgniteCheckedException` - If failed.

#### mvccLock

    @Nullable
    public @Nullable MvccUpdateResult mvccLock(GridCacheMapEntry entry,
                                                         MvccSnapshot mvccSnapshot)
                                                  throws IgniteCheckedException

Specified by:
  `mvccLock` in interface `IgniteCacheOffheapManager`
Parameters:
  `entry` - Entry.
  `mvccSnapshot` - MVCC snapshot.
Returns:
  Update result.
Throws:
  `IgniteCheckedException` - If failed.

#### mvccApplyUpdate

    public void mvccApplyUpdate(GridCacheContext cctx,
                                KeyCacheObject key,
                                CacheObject val,
                                GridCacheVersion ver,
                                long expireTime,
                                GridDhtLocalPartition part,
                                MvccVersion mvccVer)
                         throws IgniteCheckedException

Specified by:
  `mvccApplyUpdate` in interface `IgniteCacheOffheapManager`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `val` - Value.
  `ver` - Version.
  `expireTime` - Expire time.
  `part` - Partition.
  `mvccVer` - Mvcc version.
Throws:
  `IgniteCheckedException` - If failed.

#### remove

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

Specified by:
  `remove` in interface `IgniteCacheOffheapManager`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `partId` - Partition number.
  `part` - Partition.
Throws:
  `IgniteCheckedException` - If failed.

#### read

    @Nullable
    public @Nullable CacheDataRow read(GridCacheMapEntry entry)
                                          throws IgniteCheckedException

Specified by:
  `read` in interface `IgniteCacheOffheapManager`
Parameters:
  `entry` - Cache entry.
Returns:
  Cached row, if available, null otherwise.
Throws:
  `IgniteCheckedException` - If failed.

#### read

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

Specified by:
  `read` in interface `IgniteCacheOffheapManager`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
Returns:
  Cached row, if available, null otherwise.
Throws:
  `IgniteCheckedException` - If failed.

#### mvccRead

    @Nullable
    public @Nullable CacheDataRow mvccRead(GridCacheContext cctx,
                                                     KeyCacheObject key,
                                                     MvccSnapshot mvccSnapshot)
                                              throws IgniteCheckedException

Specified by:
  `mvccRead` in interface `IgniteCacheOffheapManager`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `mvccSnapshot` - MVCC snapshot.
Returns:
  Cached row, if available, null otherwise.
Throws:
  `IgniteCheckedException` - If failed.

#### mvccAllVersions

    public List<IgniteBiTuple<Object,MvccVersion>> mvccAllVersions(GridCacheContext cctx,
                                                                   KeyCacheObject key)
                                                            throws IgniteCheckedException

For testing only.

Specified by:
  `mvccAllVersions` in interface `IgniteCacheOffheapManager`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
Returns:
  All stored versions for given key.
Throws:
  `IgniteCheckedException` - If failed.

#### mvccAllVersionsCursor

    public GridCursor<CacheDataRow> mvccAllVersionsCursor(GridCacheContext cctx,
                                                          KeyCacheObject key,
                                                          Object x)
                                                   throws IgniteCheckedException

Returns iterator over the all row versions for the given key.

Specified by:
  `mvccAllVersionsCursor` in interface `IgniteCacheOffheapManager`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `x` - Implementation specific argument, `null` always means that we need to return full detached data row.
Returns:
  Iterator over all versions.
Throws:
  `IgniteCheckedException` - If failed.

#### containsKey

    public boolean containsKey(GridCacheMapEntry entry)

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

Specified by:
  `containsKey` in interface `IgniteCacheOffheapManager`

#### onPartitionCounterUpdated

    public void onPartitionCounterUpdated(int part,
                                          long cntr)

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

Specified by:
  `onPartitionCounterUpdated` in interface `IgniteCacheOffheapManager`
Parameters:
  `part` - Partition.
  `cntr` - Partition counter.

#### onPartitionInitialCounterUpdated

    public void onPartitionInitialCounterUpdated(int part,
                                                 long start,
                                                 long delta)

Initial counter will be updated on state restore only

Specified by:
  `onPartitionInitialCounterUpdated` in interface `IgniteCacheOffheapManager`
Parameters:
  `part` - Partition
  `start` - Start.
  `delta` - Delta.

#### lastUpdatedPartitionCounter

    public long lastUpdatedPartitionCounter(int part)

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

Specified by:
  `lastUpdatedPartitionCounter` in interface `IgniteCacheOffheapManager`
Parameters:
  `part` - Partition ID.
Returns:
  Last updated counter.

#### clearCache

    public void clearCache(GridCacheContext cctx,
                           boolean readers)

Clears offheap entries.

Specified by:
  `clearCache` in interface `IgniteCacheOffheapManager`
Parameters:
  `readers` - `True` to clear readers.
  `cctx` - Cache context.

#### onUndeploy

    public int onUndeploy(ClassLoader ldr)

Specified by:
  `onUndeploy` in interface `IgniteCacheOffheapManager`
Parameters:
  `ldr` - Class loader.
Returns:
  Number of undeployed entries.

#### offHeapAllocatedSize

    public long offHeapAllocatedSize()

Specified by:
  `offHeapAllocatedSize` in interface `IgniteCacheOffheapManager`
Returns:
  Offheap allocated size.

#### cacheEntriesIterator

    public <K,V> GridCloseableIterator<javax.cache.Cache.Entry<K,V>> cacheEntriesIterator(GridCacheContext cctx,
                                                                                          boolean primary,
                                                                                          boolean backup,
                                                                                          AffinityTopologyVersion topVer,
                                                                                          boolean keepBinary,
                                                                                          @Nullable
                                                                                          @Nullable MvccSnapshot mvccSnapshot,
                                                                                          Boolean dataPageScanEnabled)

Specified by:
  `cacheEntriesIterator` in interface `IgniteCacheOffheapManager`
Parameters:
  `cctx` - Cache context.
  `primary` - `True` if need to return primary entries.
  `backup` - `True` if need to return backup entries.
  `topVer` - Topology version.
  `keepBinary` - Keep binary flag.
  `mvccSnapshot` - MVCC snapshot.
  `dataPageScanEnabled` - Flag to enable data page scan.
Returns:
  Entries iterator.

#### cacheKeysIterator

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

Specified by:
  `cacheKeysIterator` in interface `IgniteCacheOffheapManager`
Parameters:
  `cacheId` - Cache ID.
  `part` - Partition.
Returns:
  Iterator.
Throws:
  `IgniteCheckedException` - If failed.

#### cacheIterator

    public GridIterator<CacheDataRow> cacheIterator(int cacheId,
                                                    boolean primary,
                                                    boolean backups,
                                                    AffinityTopologyVersion topVer,
                                                    @Nullable
                                                    @Nullable MvccSnapshot mvccSnapshot,
                                                    Boolean dataPageScanEnabled)

Specified by:
  `cacheIterator` in interface `IgniteCacheOffheapManager`
Parameters:
  `cacheId` - Cache ID.
  `primary` - Primary entries flag.
  `backups` - Backup entries flag.
  `topVer` - Topology version.
  `mvccSnapshot` - MVCC snapshot.
  `dataPageScanEnabled` - Flag to enable data page scan.
Returns:
  Rows iterator.

#### cachePartitionIterator

    public GridIterator<CacheDataRow> cachePartitionIterator(int cacheId,
                                                             int part,
                                                             @Nullable
                                                             @Nullable MvccSnapshot mvccSnapshot,
                                                             Boolean dataPageScanEnabled)

Specified by:
  `cachePartitionIterator` in interface `IgniteCacheOffheapManager`
Parameters:
  `cacheId` - Cache ID.
  `part` - Partition.
  `mvccSnapshot` - MVCC snapshot.
  `dataPageScanEnabled` - Flag to enable data page scan.
Returns:
  Partition data iterator.

#### partitionIterator

    public GridIterator<CacheDataRow> partitionIterator(int part)

Specified by:
  `partitionIterator` in interface `IgniteCacheOffheapManager`
Parameters:
  `part` - Partition number.
Returns:
  Iterator for given partition.

#### rootPageForIndex

    public RootPage rootPageForIndex(int cacheId,
                                     String idxName,
                                     int segment)
                              throws IgniteCheckedException

Specified by:
  `rootPageForIndex` in interface `IgniteCacheOffheapManager`
Parameters:
  `cacheId` - Cache ID.
  `idxName` - Index name.
  `segment` - Segment.
Returns:
  Root page for index tree.
Throws:
  `IgniteCheckedException` - If failed.

#### dropRootPageForIndex

    public void dropRootPageForIndex(int cacheId,
                                     String idxName,
                                     int segment)
                              throws IgniteCheckedException

Specified by:
  `dropRootPageForIndex` in interface `IgniteCacheOffheapManager`
Parameters:
  `cacheId` - Cache ID.
  `idxName` - Index name.
Throws:
  `IgniteCheckedException` - If failed.

#### reuseListForIndex

    public ReuseList reuseListForIndex(String idxName)

Specified by:
  `reuseListForIndex` in interface `IgniteCacheOffheapManager`
Parameters:
  `idxName` - Index name.
Returns:
  Reuse list for index tree.

#### reservedIterator

    public GridCloseableIterator<CacheDataRow> reservedIterator(int part,
                                                                AffinityTopologyVersion topVer)
                                                         throws IgniteCheckedException

Specified by:
  `reservedIterator` in interface `IgniteCacheOffheapManager`
Parameters:
  `part` - Partition number.
  `topVer` - Topology version.
Returns:
  Iterator for given partition that will reserve partition state until it is closed.
Throws:
  `IgniteCheckedException` - If failed.

#### rebalanceIterator

    public IgniteRebalanceIterator rebalanceIterator(IgniteDhtDemandedPartitionsMap parts,
                                                     AffinityTopologyVersion topVer)
                                              throws IgniteCheckedException

Specified by:
  `rebalanceIterator` in interface `IgniteCacheOffheapManager`
Parameters:
  `parts` - Partitions.
Returns:
  Partition data iterator.
Throws:
  `IgniteCheckedException` - If failed.

#### historicalIterator

    @Nullable
    protected @Nullable IgniteHistoricalIterator historicalIterator(CachePartitionPartialCountersMap partCntrs,
                                                                              Set<Integer> missing)
                                                                       throws IgniteCheckedException

Parameters:
  `partCntrs` - Partition counters map.
  `missing` - Set of partitions need to populate if partition is missing or failed to reserve.
Returns:
  Historical iterator.
Throws:
  `IgniteCheckedException` - If failed.

#### storeEntries

    public void storeEntries(int partId,
                             Iterator<GridCacheEntryInfo> infos,
                             IgnitePredicateX<CacheDataRow> initPred)
                      throws IgniteCheckedException

Store entries.

Specified by:
  `storeEntries` in interface `IgniteCacheOffheapManager`
Parameters:
  `partId` - Partition number.
  `infos` - Entry infos.
  `initPred` - Applied to all created rows. Each row that not matches the predicate is removed.
Throws:
  `IgniteCheckedException` - If failed.

#### createCacheDataStore

    public final IgniteCacheOffheapManager.CacheDataStore createCacheDataStore(int p)
                                                                        throws IgniteCheckedException

Specified by:
  `createCacheDataStore` in interface `IgniteCacheOffheapManager`
Parameters:
  `p` - Partition.
Returns:
  Data store.
Throws:
  `IgniteCheckedException` - If failed.

#### createCacheDataStore0

    protected IgniteCacheOffheapManager.CacheDataStore createCacheDataStore0(int p)
                                                                      throws IgniteCheckedException

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

#### cacheDataStores

    public Iterable<IgniteCacheOffheapManager.CacheDataStore> cacheDataStores()

Specified by:
  `cacheDataStores` in interface `IgniteCacheOffheapManager`
Returns:
  Iterable over all existing cache data stores.

#### destroyCacheDataStore

    public final void destroyCacheDataStore(IgniteCacheOffheapManager.CacheDataStore store)
                                     throws IgniteCheckedException

Specified by:
  `destroyCacheDataStore` in interface `IgniteCacheOffheapManager`
Parameters:
  `store` - Data store.
Throws:
  `IgniteCheckedException` - If failed.

#### destroyCacheDataStore0

    protected void destroyCacheDataStore0(IgniteCacheOffheapManager.CacheDataStore store)
                                   throws IgniteCheckedException

Parameters:
  `store` - Cache data store.
Throws:
  `IgniteCheckedException` - If failed.

#### treeName

    protected final String treeName(int p)

Parameters:
  `p` - Partition.
Returns:
  Tree name for given partition.

#### expire

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

Specified by:
  `expire` in interface `IgniteCacheOffheapManager`
Parameters:
  `cctx` - Cache context.
  `c` - Closure.
  `amount` - Limit of processed entries by single call, `-1` for no limit.
Returns:
  `True` if unprocessed expired entries remains.
Throws:
  `IgniteCheckedException` - If failed.

#### expiredSize

    public long expiredSize()
                     throws IgniteCheckedException

Gets the number of entries pending expire.

Specified by:
  `expiredSize` in interface `IgniteCacheOffheapManager`
Returns:
  Number of pending entries.
Throws:
  `IgniteCheckedException` - If failed to get number of pending entries.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020