public class IgniteCacheOffheapManagerImpl extends Object implements IgniteCacheOffheapManager
| Modifier and Type | Class and Description |
|---|---|
protected class |
IgniteCacheOffheapManagerImpl.CacheDataStoreImpl |
IgniteCacheOffheapManager.CacheDataStore, IgniteCacheOffheapManager.OffheapInvokeClosure| Modifier and Type | Field and Description |
|---|---|
protected GridSpinBusyLock |
busyLock |
protected GridCacheSharedContext |
ctx |
protected CacheGroupContext |
grp |
protected boolean |
hasPendingEntries |
protected IgniteLogger |
log |
protected long |
nextCleanTime
Timestamp when next clean try will be allowed.
|
protected ConcurrentMap<Integer,IgniteCacheOffheapManager.CacheDataStore> |
partDataStores |
protected GridStripedLock |
partStoreLock |
static long |
UNWIND_THROTTLING_TIMEOUT
Throttling timeout in millis which avoid excessive PendingTree access on unwind
if there is nothing to clean yet.
|
| Constructor and Description |
|---|
IgniteCacheOffheapManagerImpl() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcachePartitionIterator, mvccInitialValuepublic static final long UNWIND_THROTTLING_TIMEOUT
protected GridCacheSharedContext ctx
protected CacheGroupContext grp
protected IgniteLogger log
protected final ConcurrentMap<Integer,IgniteCacheOffheapManager.CacheDataStore> partDataStores
protected volatile boolean hasPendingEntries
protected volatile long nextCleanTime
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 void onKernalStop()
onKernalStop in interface IgniteCacheOffheapManagerpublic IgniteCacheOffheapManager.CacheDataStore dataStore(GridDhtLocalPartition part)
dataStore in interface IgniteCacheOffheapManagerpart - Partition.public IgniteCacheOffheapManager.CacheDataStore dataStore(int part)
part - Partition.public long cacheEntriesCount(int cacheId)
cacheEntriesCount in interface IgniteCacheOffheapManagercacheId - Cache ID.public long totalPartitionEntriesCount(int p)
totalPartitionEntriesCount in interface IgniteCacheOffheapManagerp - Partition.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 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 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 mvccInitialValueIfAbsent(GridCacheMapEntry entry, CacheObject val, GridCacheVersion ver, long expireTime, MvccVersion mvccVer, MvccVersion newMvccVer, byte txState, byte newTxState) throws IgniteCheckedException
mvccInitialValueIfAbsent in interface IgniteCacheOffheapManagerentry - Entry.val - Value.ver - Version.expireTime - Expire time.mvccVer - MVCC version.newMvccVer - New MVCC version.txState - Tx state hint for the mvcc version.newTxState - Tx state hint for the new mvcc version.True if value was inserted.IgniteCheckedException - If failed.public boolean mvccUpdateRowWithPreloadInfo(GridCacheMapEntry entry, @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 CacheEntryPredicate filter, boolean retVal, 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.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 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 GridLongList mvccUpdateNative(boolean primary, GridCacheMapEntry entry, CacheObject val, GridCacheVersion ver, long expireTime, MvccSnapshot mvccSnapshot) throws IgniteCheckedException
mvccUpdateNative in interface IgniteCacheOffheapManagerprimary - True if on primary node.entry - Entry.val - Value.ver - Cache version.expireTime - Expire time.mvccSnapshot - MVCC snapshot.IgniteCheckedException - If failed.public GridLongList mvccRemoveNative(boolean primary, GridCacheMapEntry entry, MvccSnapshot mvccSnapshot) throws IgniteCheckedException
mvccRemoveNative in interface IgniteCacheOffheapManagerprimary - True if on primary node.entry - Entry.mvccSnapshot - MVCC snapshot.IgniteCheckedException - If failed.public void mvccRemoveAll(GridCacheMapEntry entry) throws IgniteCheckedException
mvccRemoveAll in interface IgniteCacheOffheapManagerentry - Entry.IgniteCheckedException - If failed.@Nullable public 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 CacheDataRow read(GridCacheMapEntry entry) throws IgniteCheckedException
read in interface IgniteCacheOffheapManagerentry - Cache entry.IgniteCheckedException - If failed.@Nullable public CacheDataRow read(GridCacheContext cctx, KeyCacheObject key) throws IgniteCheckedException
read in interface IgniteCacheOffheapManagercctx - Cache context.key - Key.IgniteCheckedException - If failed.@Nullable public CacheDataRow mvccRead(GridCacheContext cctx, KeyCacheObject key, MvccSnapshot ver) throws IgniteCheckedException
mvccRead in interface IgniteCacheOffheapManagercctx - Cache context.key - Key.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 onPartitionCounterUpdated(int part,
long cntr)
onPartitionCounterUpdated in interface IgniteCacheOffheapManagerpart - Partition.cntr - Partition counter.public void onPartitionInitialCounterUpdated(int part,
long cntr)
onPartitionInitialCounterUpdated in interface IgniteCacheOffheapManagerpart - Partitioncntr - New initial counterpublic long lastUpdatedPartitionCounter(int part)
lastUpdatedPartitionCounter in interface IgniteCacheOffheapManagerpart - Partition ID.public 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) throws IgniteCheckedException
cacheEntriesIterator in interface IgniteCacheOffheapManagerprimary - True if need return primary entries.backup - True if need return backup entries.topVer - Topology version to use.cctx - Cache context.keepBinary - Keep binary flag.IgniteCheckedException - If failed.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 MvccSnapshot mvccSnapshot) throws IgniteCheckedException
cacheIterator in interface IgniteCacheOffheapManagercacheId - Cache ID.primary - Primary entries flag.backups - Backup entries flag.topVer - Topology version.IgniteCheckedException - If failed.public GridIterator<CacheDataRow> cachePartitionIterator(int cacheId, int part, @Nullable MvccSnapshot mvccSnapshot) throws IgniteCheckedException
cachePartitionIterator in interface IgniteCacheOffheapManagercacheId - Cache ID.part - Partition.mvccSnapshot - MVCC snapshot.IgniteCheckedException - If failed.public GridIterator<CacheDataRow> partitionIterator(int part) throws IgniteCheckedException
partitionIterator in interface IgniteCacheOffheapManagerpart - Partition number.IgniteCheckedException - If failed.public RootPage rootPageForIndex(int cacheId, String idxName) throws IgniteCheckedException
rootPageForIndex in interface IgniteCacheOffheapManagercacheId - Cache ID.idxName - Index name.IgniteCheckedException - If failed.public void dropRootPageForIndex(int cacheId,
String idxName)
throws IgniteCheckedException
dropRootPageForIndex in interface IgniteCacheOffheapManagercacheId - Cache ID.idxName - Index name.IgniteCheckedException - If failed.public ReuseList reuseListForIndex(String idxName)
reuseListForIndex in interface IgniteCacheOffheapManageridxName - Index name.public GridCloseableIterator<CacheDataRow> reservedIterator(int part, AffinityTopologyVersion topVer) throws IgniteCheckedException
reservedIterator in interface IgniteCacheOffheapManagerpart - Partition number.topVer - Topology version.IgniteCheckedException - If failed.public IgniteRebalanceIterator rebalanceIterator(IgniteDhtDemandedPartitionsMap parts, AffinityTopologyVersion topVer) throws IgniteCheckedException
rebalanceIterator in interface IgniteCacheOffheapManagerparts - Partitions.IgniteCheckedException - If failed.@Nullable protected 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.IgniteCheckedExceptionpublic 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 Iterable<IgniteCacheOffheapManager.CacheDataStore> cacheDataStores()
cacheDataStores in interface IgniteCacheOffheapManagerpublic 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.7.5 Release Date : June 4 2019