public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl implements CheckpointListener
Modifier and Type | Class and Description |
---|---|
static class |
GridCacheOffheapManager.GridCacheDataStore |
IgniteCacheOffheapManagerImpl.CacheDataStoreImpl
CheckpointListener.Context
IgniteCacheOffheapManager.CacheDataStore, IgniteCacheOffheapManager.OffheapInvokeClosure
Modifier and Type | Field and Description |
---|---|
static int |
DFLT_WAL_MARGIN_FOR_ATOMIC_CACHE_HISTORICAL_REBALANCE |
static GridCursor<CacheDataRow> |
EMPTY_CURSOR |
static String |
WAL_MARGIN_FOR_ATOMIC_CACHE_HISTORICAL_REBALANCE |
busyLock, ctx, grp, log, partDataStores, partStoreLock, PRELOAD_SIZE_UNDER_CHECKPOINT_LOCK
Constructor and Description |
---|
GridCacheOffheapManager() |
Modifier and Type | Method and Description |
---|---|
void |
afterCheckpointEnd(CheckpointListener.Context ctx)
Do some actions after checkpoint end.
|
void |
beforeCheckpointBegin(CheckpointListener.Context ctx)
Do some actions before checkpoint write lock.
|
protected IgniteCacheOffheapManager.CacheDataStore |
createCacheDataStore0(int p) |
GridCacheOffheapManager.GridCacheDataStore |
createGridCacheDataStore(CacheGroupContext grpCtx,
int partId,
boolean exists,
IgniteLogger log) |
protected void |
destroyCacheDataStore0(IgniteCacheOffheapManager.CacheDataStore store) |
void |
destroyPartitionStore(int grpId,
int partId)
Invalidates page memory for given partition.
|
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.
|
void |
findAndCleanupLostIndexesForStoppedCache(int cacheId) |
IndexStorage |
getIndexStorage()
Get internal IndexStorage.
|
protected @Nullable IgniteHistoricalIterator |
historicalIterator(CachePartitionPartialCountersMap partCntrs,
Set<Integer> missing) |
protected void |
initDataStructures() |
protected void |
initPendingTree(GridCacheContext cctx) |
long |
lastUpdatedPartitionCounter(int part)
Partition counter provider.
|
void |
onCheckpointBegin(CheckpointListener.Context ctx) |
void |
onMarkCheckpointBegin(CheckpointListener.Context ctx) |
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
|
void |
preloadPartition(int part)
Preload a partition.
|
static @Nullable Map<Integer,Long> |
readSharedGroupCacheSizes(PageSupport pageMem,
int grpId,
long cntrsPageId)
Loads cache sizes for all caches in shared group.
|
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 |
stop() |
static long |
writeSharedGroupCacheSizes(PageMemory pageMem,
int grpId,
long cntrsPageId,
int partId,
Map<Integer,Long> sizes)
Saves cache sizes for all caches in shared group.
|
cacheDataStores, cacheEntriesCount, cacheEntriesCount, cacheEntriesCount, cacheEntriesIterator, cacheIterator, cacheKeysIterator, cachePartitionIterator, clearCache, containsKey, createCacheDataStore, dataStore, dataStore, destroyCacheDataStore, globalRemoveId, invoke, mvccAllVersions, mvccAllVersionsCursor, mvccApplyHistoryIfAbsent, mvccApplyUpdate, mvccInitialValue, mvccLock, mvccRead, mvccRemove, mvccRemoveAll, mvccUpdate, mvccUpdateRowWithPreloadInfo, offHeapAllocatedSize, onCacheStarted, onKernalStop, onUndeploy, partitionIterator, read, read, rebalanceIterator, remove, reservedIterator, start, stopCache, storeEntries, totalPartitionEntriesCount, treeName, update
public static final int DFLT_WAL_MARGIN_FOR_ATOMIC_CACHE_HISTORICAL_REBALANCE
@SystemProperty(value="The WAL iterator margin that is used to prevent partitions divergence on the historical rebalance of atomic caches", type=java.lang.Long.class, defaults="5") public static final String WAL_MARGIN_FOR_ATOMIC_CACHE_HISTORICAL_REBALANCE
public static final GridCursor<CacheDataRow> EMPTY_CURSOR
protected void initPendingTree(GridCacheContext cctx) throws IgniteCheckedException
initPendingTree
in class IgniteCacheOffheapManagerImpl
cctx
- Cache context.IgniteCheckedException
- If failed.protected void initDataStructures() throws IgniteCheckedException
initDataStructures
in class IgniteCacheOffheapManagerImpl
IgniteCheckedException
- If failed.public IndexStorage getIndexStorage()
UpgradePendingTreeToPerPartitionTask
for details.protected IgniteCacheOffheapManager.CacheDataStore createCacheDataStore0(int p) throws IgniteCheckedException
createCacheDataStore0
in class IgniteCacheOffheapManagerImpl
p
- Partition.IgniteCheckedException
- If failed.public void onCheckpointBegin(CheckpointListener.Context ctx) throws IgniteCheckedException
onCheckpointBegin
in interface CheckpointListener
IgniteCheckedException
- If failed.public void onMarkCheckpointBegin(CheckpointListener.Context ctx) throws IgniteCheckedException
onMarkCheckpointBegin
in interface CheckpointListener
IgniteCheckedException
- If failed.public void beforeCheckpointBegin(CheckpointListener.Context ctx) throws IgniteCheckedException
beforeCheckpointBegin
in interface CheckpointListener
IgniteCheckedException
- If failed.public void afterCheckpointEnd(CheckpointListener.Context ctx) throws IgniteCheckedException
afterCheckpointEnd
in interface CheckpointListener
IgniteCheckedException
- If failed.public long restorePartitionStates(Map<GroupPartitionId,Integer> partitionRecoveryStates) throws IgniteCheckedException
restorePartitionStates
in interface IgniteCacheOffheapManager
restorePartitionStates
in class IgniteCacheOffheapManagerImpl
partitionRecoveryStates
- Partition recovery states.IgniteCheckedException
- If failed.@Nullable public static @Nullable Map<Integer,Long> readSharedGroupCacheSizes(PageSupport pageMem, int grpId, long cntrsPageId) throws IgniteCheckedException
pageMem
- page memory to perform operations on pages.grpId
- Cache group ID.cntrsPageId
- Counters page ID, if zero is provided that means no counters page exist.IgniteCheckedException
- If page memory operation failed.public static long writeSharedGroupCacheSizes(PageMemory pageMem, int grpId, long cntrsPageId, int partId, Map<Integer,Long> sizes) throws IgniteCheckedException
pageMem
- page memory to perform operations on pages.grpId
- Cache group ID.cntrsPageId
- Counters page ID, if zero is provided that means no counters page exist.partId
- Partition ID.sizes
- Cache sizes of all caches in group. Not null.cntrsPageId
or new value if cache size pages were initialized.IgniteCheckedException
- if page memory operation failed.protected void destroyCacheDataStore0(IgniteCacheOffheapManager.CacheDataStore store) throws IgniteCheckedException
destroyCacheDataStore0
in class IgniteCacheOffheapManagerImpl
store
- Cache data store.IgniteCheckedException
- If failed.public void destroyPartitionStore(int grpId, int partId) throws IgniteCheckedException
grpId
- Group ID.partId
- Partition ID.IgniteCheckedException
- If destroy has failed.public void onPartitionCounterUpdated(int part, long cntr)
onPartitionCounterUpdated
in interface IgniteCacheOffheapManager
onPartitionCounterUpdated
in class IgniteCacheOffheapManagerImpl
part
- Partition.cntr
- Partition counter.public void onPartitionInitialCounterUpdated(int part, long start, long delta)
onPartitionInitialCounterUpdated
in interface IgniteCacheOffheapManager
onPartitionInitialCounterUpdated
in class IgniteCacheOffheapManagerImpl
part
- Partitionstart
- Start.delta
- Delta.public long lastUpdatedPartitionCounter(int part)
lastUpdatedPartitionCounter
in interface IgniteCacheOffheapManager
lastUpdatedPartitionCounter
in class IgniteCacheOffheapManagerImpl
part
- Partition ID.public RootPage rootPageForIndex(int cacheId, String idxName, int segment) throws IgniteCheckedException
rootPageForIndex
in interface IgniteCacheOffheapManager
rootPageForIndex
in class IgniteCacheOffheapManagerImpl
cacheId
- Cache ID.idxName
- Index name.segment
- Segment.IgniteCheckedException
- If failed.public void dropRootPageForIndex(int cacheId, String idxName, int segment) throws IgniteCheckedException
dropRootPageForIndex
in interface IgniteCacheOffheapManager
dropRootPageForIndex
in class IgniteCacheOffheapManagerImpl
cacheId
- Cache ID.idxName
- Index name.IgniteCheckedException
- If failed.public ReuseList reuseListForIndex(String idxName)
reuseListForIndex
in interface IgniteCacheOffheapManager
reuseListForIndex
in class IgniteCacheOffheapManagerImpl
idxName
- Index name.public void stop()
stop
in interface IgniteCacheOffheapManager
stop
in class IgniteCacheOffheapManagerImpl
@Nullable protected @Nullable IgniteHistoricalIterator historicalIterator(CachePartitionPartialCountersMap partCntrs, Set<Integer> missing) throws IgniteCheckedException
historicalIterator
in class IgniteCacheOffheapManagerImpl
partCntrs
- Partition counters map.missing
- Set of partitions need to populate if partition is missing or failed to reserve.IgniteCheckedException
- If failed.public boolean expire(GridCacheContext cctx, IgniteInClosure2X<GridCacheEntryEx,GridCacheVersion> c, int amount) throws IgniteCheckedException
expire
in interface IgniteCacheOffheapManager
expire
in class IgniteCacheOffheapManagerImpl
cctx
- Cache context.c
- Closure.amount
- Limit of processed entries by single call, -1
for no limit.True
if unprocessed expired entries remains.IgniteCheckedException
- If failed.public long expiredSize() throws IgniteCheckedException
expiredSize
in interface IgniteCacheOffheapManager
expiredSize
in class IgniteCacheOffheapManagerImpl
IgniteCheckedException
- If failed to get number of pending entries.public void preloadPartition(int part) throws IgniteCheckedException
preloadPartition
in interface IgniteCacheOffheapManager
preloadPartition
in class IgniteCacheOffheapManagerImpl
part
- Partition.IgniteCheckedException
- If failed.public void findAndCleanupLostIndexesForStoppedCache(int cacheId) throws IgniteCheckedException
cacheId
- Which was stopped, but its data still presented.IgniteCheckedException
- If failed.public GridCacheOffheapManager.GridCacheDataStore createGridCacheDataStore(CacheGroupContext grpCtx, int partId, boolean exists, IgniteLogger log)
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021