public class IgniteCacheOffheapManagerImpl extends Object implements IgniteCacheOffheapManager
| Modifier and Type | Class and Description |
|---|---|
static class |
IgniteCacheOffheapManagerImpl.CacheDataStoreImpl |
IgniteCacheOffheapManager.CacheDataStore, IgniteCacheOffheapManager.OffheapInvokeClosure| Modifier and Type | Field and Description |
|---|---|
protected GridSpinBusyLock |
busyLock |
protected GridCacheSharedContext |
ctx |
protected CacheGroupContext |
grp |
protected IgniteLogger |
log |
protected GridStripedLock |
partStoreLock |
static int |
PRELOAD_SIZE_UNDER_CHECKPOINT_LOCK
The maximum number of entries that can be preloaded under checkpoint read lock.
|
| Constructor and Description |
|---|
IgniteCacheOffheapManagerImpl() |
public static final int PRELOAD_SIZE_UNDER_CHECKPOINT_LOCK
protected GridCacheSharedContext ctx
protected CacheGroupContext grp
protected IgniteLogger log
protected final GridSpinBusyLock busyLock
protected GridStripedLock partStoreLock
public GridAtomicLong globalRemoveId()
globalRemoveId in interface IgniteCacheOffheapManagerpublic void start(GridCacheSharedContext ctx, CacheGroupContext grp) throws IgniteCheckedException
start in interface IgniteCacheOffheapManagerctx - Context.grp - Cache group.IgniteCheckedException - If failed.public void onCacheStarted(GridCacheContext cctx) throws IgniteCheckedException
onCacheStarted in interface IgniteCacheOffheapManagercctx - Cache context.IgniteCheckedException - If failed.protected void initPendingTree(GridCacheContext<?,?> cctx) throws IgniteCheckedException
cctx - Cache context.IgniteCheckedException - If failed.protected void initDataStructures()
throws IgniteCheckedException
IgniteCheckedException - If failed.public void stopCache(int cacheId,
boolean destroy)
stopCache in interface IgniteCacheOffheapManagercacheId - Cache ID.destroy - Destroy data flag. Setting to true will remove all cache data.public void stop()
stop in interface IgniteCacheOffheapManagerpublic Map<Integer,Long> restorePartitionStates(Map<GroupPartitionId,Integer> partRecoveryStates) throws IgniteCheckedException
restorePartitionStates in interface IgniteCacheOffheapManagerpartRecoveryStates - Partition recovery states.IgniteCheckedException - If failed.public void onKernalStop()
onKernalStop in interface IgniteCacheOffheapManagerpublic IgniteCacheOffheapManager.CacheDataStore dataStore(@Nullable @Nullable GridDhtLocalPartition part)
dataStore in interface IgniteCacheOffheapManagerpart - Local partition or null if a related cache group is LOCAL.public long cacheEntriesCount(int cacheId)
cacheEntriesCount in interface IgniteCacheOffheapManagercacheId - Cache ID.public void preloadPartition(int partId)
throws IgniteCheckedException
preloadPartition in interface IgniteCacheOffheapManagerpartId - Partition id.IgniteCheckedException - If failed.public long cacheEntriesCount(int cacheId,
boolean primary,
boolean backup,
AffinityTopologyVersion topVer)
throws IgniteCheckedException
cacheEntriesCount in interface IgniteCacheOffheapManagercacheId - Cache ID.primary - Primary entries flag.backup - Backup entries flag.topVer - Topology version.IgniteCheckedException - If failed.public long cacheEntriesCount(int cacheId,
int part)
cacheEntriesCount in interface IgniteCacheOffheapManagercacheId - Cache ID.part - Partition.public Iterable<IgniteCacheOffheapManager.CacheDataStore> cacheDataStores()
cacheDataStores in interface IgniteCacheOffheapManagerpublic void invoke(GridCacheContext cctx, KeyCacheObject key, GridDhtLocalPartition part, IgniteCacheOffheapManager.OffheapInvokeClosure c) throws IgniteCheckedException
invoke in interface IgniteCacheOffheapManagercctx - Cache context.key - Key.part - Partition.c - Tree update closure.IgniteCheckedException - If failed.public void update(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, GridDhtLocalPartition part, @Nullable @Nullable CacheDataRow oldRow) throws IgniteCheckedException
update in interface IgniteCacheOffheapManagercctx - Cache context.key - Key.val - Value.ver - Version.expireTime - Expire time.part - Partition.oldRow - Old row if available.IgniteCheckedException - If failed.public boolean mvccInitialValue(GridCacheMapEntry entry, CacheObject val, GridCacheVersion ver, long expireTime, MvccVersion mvccVer, MvccVersion newMvccVer) throws IgniteCheckedException
mvccInitialValue in interface IgniteCacheOffheapManagerentry - Entry.val - Value.ver - Version.expireTime - Expire time.mvccVer - MVCC version.newMvccVer - New MVCC version.True if value was inserted.IgniteCheckedException - If failed.public boolean mvccApplyHistoryIfAbsent(GridCacheMapEntry entry, List<GridCacheMvccEntryInfo> hist) throws IgniteCheckedException
mvccApplyHistoryIfAbsent in interface IgniteCacheOffheapManagerentry - Entry to update.hist - Full entry history.True if history applied successfully, False otherwise.IgniteCheckedExceptionpublic boolean mvccUpdateRowWithPreloadInfo(GridCacheMapEntry entry, @Nullable @Nullable CacheObject val, GridCacheVersion ver, long expireTime, MvccVersion mvccVer, MvccVersion newMvccVer, byte mvccTxState, byte newMvccTxState) throws IgniteCheckedException
mvccUpdateRowWithPreloadInfo in interface IgniteCacheOffheapManagerentry - Entry.val - Value.ver - Version.mvccVer - MVCC version.newMvccVer - New MVCC version.True if value was inserted.IgniteCheckedException - If failed.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
mvccUpdate in interface IgniteCacheOffheapManagerentry - 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.IgniteCheckedException - If failed.public MvccUpdateResult mvccRemove(GridCacheMapEntry entry, MvccSnapshot mvccSnapshot, boolean primary, boolean needHistory, boolean needOldVal, @Nullable @Nullable CacheEntryPredicate filter, boolean retVal) throws IgniteCheckedException
mvccRemove in interface IgniteCacheOffheapManagerentry - 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.IgniteCheckedException - If failed.public void mvccRemoveAll(GridCacheMapEntry entry) throws IgniteCheckedException
mvccRemoveAll in interface IgniteCacheOffheapManagerentry - Entry.IgniteCheckedException - If failed.@Nullable public @Nullable MvccUpdateResult mvccLock(GridCacheMapEntry entry, MvccSnapshot mvccSnapshot) throws IgniteCheckedException
mvccLock in interface IgniteCacheOffheapManagerentry - Entry.mvccSnapshot - MVCC snapshot.IgniteCheckedException - If failed.public void mvccApplyUpdate(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, GridDhtLocalPartition part, MvccVersion mvccVer) throws IgniteCheckedException
mvccApplyUpdate in interface IgniteCacheOffheapManagercctx - Cache context.key - Key.val - Value.ver - Version.expireTime - Expire time.part - Partition.mvccVer - Mvcc version.IgniteCheckedException - If failed.public void remove(GridCacheContext cctx, KeyCacheObject key, int partId, GridDhtLocalPartition part) throws IgniteCheckedException
remove in interface IgniteCacheOffheapManagercctx - Cache context.key - Key.partId - Partition number.part - Partition.IgniteCheckedException - If failed.@Nullable public @Nullable CacheDataRow read(GridCacheMapEntry entry) throws IgniteCheckedException
read in interface IgniteCacheOffheapManagerentry - Cache entry.IgniteCheckedException - If failed.@Nullable public @Nullable CacheDataRow read(GridCacheContext cctx, KeyCacheObject key) throws IgniteCheckedException
read in interface IgniteCacheOffheapManagercctx - Cache context.key - Key.IgniteCheckedException - If failed.@Nullable public @Nullable CacheDataRow mvccRead(GridCacheContext cctx, KeyCacheObject key, MvccSnapshot mvccSnapshot) throws IgniteCheckedException
mvccRead in interface IgniteCacheOffheapManagercctx - Cache context.key - Key.mvccSnapshot - MVCC snapshot.IgniteCheckedException - If failed.public List<IgniteBiTuple<Object,MvccVersion>> mvccAllVersions(GridCacheContext cctx, KeyCacheObject key) throws IgniteCheckedException
mvccAllVersions in interface IgniteCacheOffheapManagercctx - Cache context.key - Key.IgniteCheckedException - If failed.public GridCursor<CacheDataRow> mvccAllVersionsCursor(GridCacheContext cctx, KeyCacheObject key, Object x) throws IgniteCheckedException
mvccAllVersionsCursor in interface IgniteCacheOffheapManagercctx - Cache context.key - Key.x - Implementation specific argument, null always means that we need to return full detached data row.IgniteCheckedException - If failed.public boolean containsKey(GridCacheMapEntry entry)
containsKey in interface IgniteCacheOffheapManagerpublic void clearCache(GridCacheContext cctx, boolean readers)
clearCache in interface IgniteCacheOffheapManagerreaders - True to clear readers.cctx - Cache context.public int onUndeploy(ClassLoader ldr)
onUndeploy in interface IgniteCacheOffheapManagerldr - Class loader.public long offHeapAllocatedSize()
offHeapAllocatedSize in interface IgniteCacheOffheapManagerpublic <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)
cacheEntriesIterator in interface IgniteCacheOffheapManagercctx - 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.public GridCloseableIterator<KeyCacheObject> cacheKeysIterator(int cacheId, int part) throws IgniteCheckedException
cacheKeysIterator in interface IgniteCacheOffheapManagercacheId - Cache ID.part - Partition.IgniteCheckedException - If failed.public GridIterator<CacheDataRow> cacheIterator(int cacheId, boolean primary, boolean backups, AffinityTopologyVersion topVer, @Nullable @Nullable MvccSnapshot mvccSnapshot, Boolean dataPageScanEnabled)
cacheIterator in interface IgniteCacheOffheapManagercacheId - Cache ID.primary - Primary entries flag.backups - Backup entries flag.topVer - Topology version.mvccSnapshot - MVCC snapshot.dataPageScanEnabled - Flag to enable data page scan.public GridIterator<CacheDataRow> cachePartitionIterator(int cacheId, int part, @Nullable @Nullable MvccSnapshot mvccSnapshot, Boolean dataPageScanEnabled)
cachePartitionIterator in interface IgniteCacheOffheapManagercacheId - Cache ID.part - Partition.mvccSnapshot - MVCC snapshot.dataPageScanEnabled - Flag to enable data page scan.public GridIterator<CacheDataRow> partitionIterator(int part)
partitionIterator in interface IgniteCacheOffheapManagerpart - Partition number.public RootPage rootPageForIndex(int cacheId, String idxName, int segment) throws IgniteCheckedException
rootPageForIndex in interface IgniteCacheOffheapManagercacheId - Cache ID.idxName - Index name.segment - Segment.IgniteCheckedException - If failed.@Nullable public @Nullable RootPage findRootPageForIndex(int cacheId, String idxName, int segment) throws IgniteCheckedException
findRootPageForIndex in interface IgniteCacheOffheapManagercacheId - Cache ID.idxName - Index name.IgniteCheckedException - If failed.@Nullable public @Nullable RootPage dropRootPageForIndex(int cacheId, String idxName, int segment) throws IgniteCheckedException
dropRootPageForIndex in interface IgniteCacheOffheapManagercacheId - Cache ID.idxName - Index name.segment - Segment index.IgniteCheckedException - If failed.@Nullable public @Nullable RootPage renameRootPageForIndex(int cacheId, String oldIdxName, String newIdxName, int segment) throws IgniteCheckedException
renameRootPageForIndex in interface IgniteCacheOffheapManagercacheId - Cache id.oldIdxName - Old name of the index tree.newIdxName - New name of the index tree.segment - Segment index.IgniteCheckedException - If failed.public ReuseList reuseListForIndex(String idxName)
reuseListForIndex in interface IgniteCacheOffheapManageridxName - Index name.public GridCloseableIterator<CacheDataRow> reservedIterator(int part, AffinityTopologyVersion topVer)
reservedIterator in interface IgniteCacheOffheapManagerpart - Partition number.topVer - Topology version.public IgniteRebalanceIterator rebalanceIterator(IgniteDhtDemandedPartitionsMap parts, AffinityTopologyVersion topVer) throws IgniteCheckedException
rebalanceIterator in interface IgniteCacheOffheapManagerparts - Partitions.IgniteCheckedException - If failed.@Nullable protected @Nullable IgniteHistoricalIterator historicalIterator(CachePartitionPartialCountersMap partCntrs, Set<Integer> missing) throws IgniteCheckedException
partCntrs - Partition counters map.missing - Set of partitions need to populate if partition is missing or failed to reserve.IgniteCheckedException - If failed.public void storeEntries(GridDhtLocalPartition part, Iterator<GridCacheEntryInfo> infos, IgnitePredicateX<CacheDataRow> initPred) throws IgniteCheckedException
storeEntries in interface IgniteCacheOffheapManagerpart - Local partition.infos - Entry infos.initPred - Applied to all created rows. Each row that not matches the predicate is removed.IgniteCheckedException - If failed.public final IgniteCacheOffheapManager.CacheDataStore createCacheDataStore(int p) throws IgniteCheckedException
createCacheDataStore in interface IgniteCacheOffheapManagerp - Partition.IgniteCheckedException - If failed.protected IgniteCacheOffheapManager.CacheDataStore createCacheDataStore0(int p) throws IgniteCheckedException
p - Partition.IgniteCheckedException - If failed.public final void destroyCacheDataStore(IgniteCacheOffheapManager.CacheDataStore store) throws IgniteCheckedException
destroyCacheDataStore in interface IgniteCacheOffheapManagerstore - Data store.IgniteCheckedException - If failed.protected void destroyCacheDataStore0(IgniteCacheOffheapManager.CacheDataStore store) throws IgniteCheckedException
store - Cache data store.IgniteCheckedException - If failed.protected final String treeName(int p)
p - Partition.public boolean expire(GridCacheContext cctx, IgniteInClosure2X<GridCacheEntryEx,GridCacheVersion> c, int amount) throws IgniteCheckedException
expire in interface IgniteCacheOffheapManagercctx - 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 IgniteCacheOffheapManagerIgniteCheckedException - If failed to get number of pending entries.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.12.0 Release Date : January 10 2022