protected class IgniteCacheOffheapManagerImpl.CacheDataStoreImpl extends Object implements IgniteCacheOffheapManager.CacheDataStore
| Modifier and Type | Field and Description |
|---|---|
protected PartitionUpdateCounter |
pCntr
Update counter.
|
| Constructor and Description |
|---|
CacheDataStoreImpl(int partId,
CacheDataRowStore rowStore,
CacheDataTree dataTree) |
| Modifier and Type | Method and Description |
|---|---|
long |
cacheSize(int cacheId) |
Map<Integer,Long> |
cacheSizes() |
int |
cleanup(GridCacheContext cctx,
@Nullable List<MvccLinkAwareSearchRow> cleanupRows) |
void |
clear(int cacheId)
Clears all the records associated with logical cache with given ID.
|
CacheDataRow |
createRow(GridCacheContext cctx,
KeyCacheObject key,
CacheObject val,
GridCacheVersion ver,
long expireTime,
@Nullable CacheDataRow oldRow) |
GridCursor<? extends CacheDataRow> |
cursor() |
GridCursor<? extends CacheDataRow> |
cursor(int cacheId) |
GridCursor<? extends CacheDataRow> |
cursor(int cacheId,
KeyCacheObject lower,
KeyCacheObject upper) |
GridCursor<? extends CacheDataRow> |
cursor(int cacheId,
KeyCacheObject lower,
KeyCacheObject upper,
Object x) |
GridCursor<? extends CacheDataRow> |
cursor(int cacheId,
KeyCacheObject lower,
KeyCacheObject upper,
Object x,
MvccSnapshot snapshot) |
GridCursor<? extends CacheDataRow> |
cursor(int cacheId,
MvccSnapshot mvccSnapshot) |
GridCursor<? extends CacheDataRow> |
cursor(MvccSnapshot mvccSnapshot) |
GridCursor<? extends CacheDataRow> |
cursor(Object x) |
void |
destroy()
Destroys the tree associated with the store.
|
GridLongList |
finalizeUpdateCounters()
Flushes pending update counters closing all possible gaps.
|
CacheDataRow |
find(GridCacheContext cctx,
KeyCacheObject key) |
long |
fullSize() |
long |
getAndIncrementUpdateCounter(long delta)
Returns current value and updates counter by delta.
|
boolean |
init()
Initialize data store if it exists.
|
long |
initialUpdateCounter() |
void |
insertRows(Collection<DataRowCacheAware> rows,
IgnitePredicateX<CacheDataRow> initPred)
Insert rows into page memory.
|
void |
invoke(GridCacheContext cctx,
KeyCacheObject key,
IgniteCacheOffheapManager.OffheapInvokeClosure c) |
boolean |
isEmpty() |
void |
markDestroyed()
Mark store as destroyed.
|
GridCursor<CacheDataRow> |
mvccAllVersionsCursor(GridCacheContext cctx,
KeyCacheObject key,
Object x)
Returns iterator over the all row versions for the given key.
|
boolean |
mvccApplyHistoryIfAbsent(GridCacheContext cctx,
KeyCacheObject key,
List<GridCacheMvccEntryInfo> hist)
Tries to apply entry history.
|
void |
mvccApplyUpdate(GridCacheContext cctx,
KeyCacheObject key,
CacheObject val,
GridCacheVersion ver,
long expireTime,
MvccVersion mvccVer) |
CacheDataRow |
mvccFind(GridCacheContext cctx,
KeyCacheObject key,
MvccSnapshot snapshot) |
List<IgniteBiTuple<Object,MvccVersion>> |
mvccFindAllVersions(GridCacheContext cctx,
KeyCacheObject key)
For testing only.
|
boolean |
mvccInitialValue(GridCacheContext cctx,
KeyCacheObject key,
@Nullable CacheObject val,
GridCacheVersion ver,
long expireTime,
MvccVersion mvccVer,
MvccVersion newMvccVer) |
MvccUpdateResult |
mvccLock(GridCacheContext cctx,
KeyCacheObject key,
MvccSnapshot mvccSnapshot) |
MvccUpdateResult |
mvccRemove(GridCacheContext cctx,
KeyCacheObject key,
MvccSnapshot mvccSnapshot,
@Nullable CacheEntryPredicate filter,
boolean primary,
boolean needHistory,
boolean needOldVal,
boolean retVal) |
void |
mvccRemoveAll(GridCacheContext cctx,
KeyCacheObject key) |
MvccUpdateResult |
mvccUpdate(GridCacheContext cctx,
KeyCacheObject key,
CacheObject val,
GridCacheVersion ver,
long expireTime,
MvccSnapshot mvccSnapshot,
@Nullable CacheEntryPredicate filter,
javax.cache.processor.EntryProcessor entryProc,
Object[] invokeArgs,
boolean primary,
boolean needHistory,
boolean noCreate,
boolean needOldVal,
boolean retVal,
boolean keepBinary) |
boolean |
mvccUpdateRowWithPreloadInfo(GridCacheContext cctx,
KeyCacheObject key,
@Nullable CacheObject val,
GridCacheVersion ver,
long expireTime,
MvccVersion mvccVer,
MvccVersion newMvccVer,
byte mvccTxState,
byte newMvccTxState)
Apply update with full history.
|
long |
nextUpdateCounter() |
int |
partId() |
PartitionMetaStorage<SimpleDataRow> |
partStorage()
Partition storage.
|
PartitionUpdateCounter |
partUpdateCounter() |
PendingEntriesTree |
pendingTree()
Return PendingTree for data store.
|
void |
preload()
Preload a store into page memory.
|
void |
remove(GridCacheContext cctx,
KeyCacheObject key,
int partId) |
long |
reserve(long delta) |
long |
reservedCounter() |
void |
resetInitialUpdateCounter()
Reset the initial value of the partition counter.
|
void |
resetUpdateCounter()
Reset counter for partition.
|
void |
restoreState(long size,
long updCntr,
@Nullable Map<Integer,Long> cacheSizes,
byte[] cntrUpdData) |
RowStore |
rowStore() |
void |
setRowCacheCleaner(GridQueryRowCacheCleaner rowCacheCleaner)
Inject rows cache cleaner.
|
void |
update(GridCacheContext cctx,
KeyCacheObject key,
CacheObject val,
GridCacheVersion ver,
long expireTime,
@Nullable CacheDataRow oldRow) |
long |
updateCounter() |
void |
updateCounter(long val) |
boolean |
updateCounter(long start,
long delta)
Updates counters from start value by delta value.
|
void |
updateInitialCounter(long start,
long delta) |
void |
updateSize(int cacheId,
long delta)
Updates size metric for particular cache.
|
void |
updateTxState(GridCacheContext cctx,
CacheSearchRow row) |
protected final PartitionUpdateCounter pCntr
public CacheDataStoreImpl(int partId,
CacheDataRowStore rowStore,
CacheDataTree dataTree)
partId - Partition number.rowStore - Row store.dataTree - Data tree.public boolean init()
init in interface IgniteCacheOffheapManager.CacheDataStoreTrue if initialized.public int partId()
partId in interface IgniteCacheOffheapManager.CacheDataStorepublic long cacheSize(int cacheId)
cacheSize in interface IgniteCacheOffheapManager.CacheDataStorecacheId - Cache ID.public Map<Integer,Long> cacheSizes()
cacheSizes in interface IgniteCacheOffheapManager.CacheDataStorepublic long fullSize()
fullSize in interface IgniteCacheOffheapManager.CacheDataStorepublic boolean isEmpty()
isEmpty in interface IgniteCacheOffheapManager.CacheDataStoreTrue if there are no items in the store.public void updateSize(int cacheId,
long delta)
updateSize in interface IgniteCacheOffheapManager.CacheDataStorecacheId - Cache ID.delta - Size delta.public long nextUpdateCounter()
nextUpdateCounter in interface IgniteCacheOffheapManager.CacheDataStorepublic long initialUpdateCounter()
initialUpdateCounter in interface IgniteCacheOffheapManager.CacheDataStorepublic void updateInitialCounter(long start,
long delta)
updateInitialCounter in interface IgniteCacheOffheapManager.CacheDataStorestart - Start.delta - Delta.public long getAndIncrementUpdateCounter(long delta)
getAndIncrementUpdateCounter in interface IgniteCacheOffheapManager.CacheDataStoredelta - Delta.public long updateCounter()
updateCounter in interface IgniteCacheOffheapManager.CacheDataStorepublic long reservedCounter()
reservedCounter in interface IgniteCacheOffheapManager.CacheDataStorepublic PartitionUpdateCounter partUpdateCounter()
partUpdateCounter in interface IgniteCacheOffheapManager.CacheDataStorenull if store is not yet created.public long reserve(long delta)
reserve in interface IgniteCacheOffheapManager.CacheDataStoredelta - Delta.public void updateCounter(long val)
updateCounter in interface IgniteCacheOffheapManager.CacheDataStoreval - Update counter.public boolean updateCounter(long start,
long delta)
updateCounter in interface IgniteCacheOffheapManager.CacheDataStorestart - Start.delta - Delta.public GridLongList finalizeUpdateCounters()
finalizeUpdateCounters in interface IgniteCacheOffheapManager.CacheDataStorepublic void invoke(GridCacheContext cctx, KeyCacheObject key, IgniteCacheOffheapManager.OffheapInvokeClosure c) throws IgniteCheckedException
invoke in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.c - Closure.IgniteCheckedException - If failed.public CacheDataRow createRow(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, @Nullable @Nullable CacheDataRow oldRow) throws IgniteCheckedException
createRow in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.val - Value.ver - Version.expireTime - Expire time.oldRow - Old row.IgniteCheckedException - If failed.public void insertRows(Collection<DataRowCacheAware> rows, IgnitePredicateX<CacheDataRow> initPred) throws IgniteCheckedException
insertRows in interface IgniteCacheOffheapManager.CacheDataStorerows - Rows.initPred - Applied to all rows. Each row that not matches the predicate is removed.IgniteCheckedException - If failed.public boolean mvccInitialValue(GridCacheContext cctx, KeyCacheObject key, @Nullable @Nullable CacheObject val, GridCacheVersion ver, long expireTime, MvccVersion mvccVer, MvccVersion newMvccVer) throws IgniteCheckedException
mvccInitialValue in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.val - Value.ver - Version.mvccVer - MVCC version.newMvccVer - New MVCC version.True if new value was inserted.IgniteCheckedException - If failed.public boolean mvccApplyHistoryIfAbsent(GridCacheContext cctx, KeyCacheObject key, List<GridCacheMvccEntryInfo> hist) throws IgniteCheckedException
mvccApplyHistoryIfAbsent in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.hist - Full entry history.True if entry history applied successfully, False otherwise.IgniteCheckedExceptionpublic boolean mvccUpdateRowWithPreloadInfo(GridCacheContext cctx, KeyCacheObject key, @Nullable @Nullable CacheObject val, GridCacheVersion ver, long expireTime, MvccVersion mvccVer, MvccVersion newMvccVer, byte mvccTxState, byte newMvccTxState) throws IgniteCheckedException
mvccUpdateRowWithPreloadInfo in interface IgniteCacheOffheapManager.CacheDataStorecctx - Grid cache context.key - Key.val - Value.ver - Version.expireTime - Expiration time.mvccVer - Mvcc version.newMvccVer - New mvcc version.true on success.IgniteCheckedExceptionpublic MvccUpdateResult mvccUpdate(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, MvccSnapshot mvccSnapshot, @Nullable @Nullable CacheEntryPredicate filter, javax.cache.processor.EntryProcessor entryProc, Object[] invokeArgs, boolean primary, boolean needHistory, boolean noCreate, boolean needOldVal, boolean retVal, boolean keepBinary) throws IgniteCheckedException
mvccUpdate in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.val - Value.ver - Version.expireTime - Expire time.mvccSnapshot - MVCC snapshot.filter - Filter.entryProc - Entry processor.invokeArgs - Entry processor invoke arguments.primary - True if update is executed 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.retVal - Flag to return previous value.keepBinary - Keep binary flag.IgniteCheckedException - If failed.public MvccUpdateResult mvccRemove(GridCacheContext cctx, KeyCacheObject key, MvccSnapshot mvccSnapshot, @Nullable @Nullable CacheEntryPredicate filter, boolean primary, boolean needHistory, boolean needOldVal, boolean retVal) throws IgniteCheckedException
mvccRemove in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.mvccSnapshot - MVCC snapshot.filter - Filter.primary - True if update is executed on primary node.needHistory - Flag to collect history.needOldVal - True if need old value.retVal - Flag to return previous value.IgniteCheckedException - If failed.public MvccUpdateResult mvccLock(GridCacheContext cctx, KeyCacheObject key, MvccSnapshot mvccSnapshot) throws IgniteCheckedException
mvccLock in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.mvccSnapshot - MVCC snapshot.IgniteCheckedException - If failed.public void mvccRemoveAll(GridCacheContext cctx, KeyCacheObject key) throws IgniteCheckedException
mvccRemoveAll in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.IgniteCheckedException - If failed.public int cleanup(GridCacheContext cctx, @Nullable @Nullable List<MvccLinkAwareSearchRow> cleanupRows) throws IgniteCheckedException
cleanup in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.cleanupRows - Rows to cleanup.IgniteCheckedException - If failed.public void updateTxState(GridCacheContext cctx, CacheSearchRow row) throws IgniteCheckedException
updateTxState in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.row - Row.IgniteCheckedExceptionpublic void update(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, @Nullable @Nullable CacheDataRow oldRow) throws IgniteCheckedException
update in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.val - Value.ver - Version.expireTime - Expire time.oldRow - Old row if available.IgniteCheckedException - If failed.public void mvccApplyUpdate(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, MvccVersion mvccVer) throws IgniteCheckedException
mvccApplyUpdate in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.val - Value.ver - Version.expireTime - Expire time.mvccVer - Mvcc version.IgniteCheckedExceptionpublic void remove(GridCacheContext cctx, KeyCacheObject key, int partId) throws IgniteCheckedException
remove in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.partId - Partition number.IgniteCheckedException - If failed.public CacheDataRow find(GridCacheContext cctx, KeyCacheObject key) throws IgniteCheckedException
find in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.IgniteCheckedException - If failed.public List<IgniteBiTuple<Object,MvccVersion>> mvccFindAllVersions(GridCacheContext cctx, KeyCacheObject key) throws IgniteCheckedException
mvccFindAllVersions in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.IgniteCheckedException - If failed.public GridCursor<CacheDataRow> mvccAllVersionsCursor(GridCacheContext cctx, KeyCacheObject key, Object x) throws IgniteCheckedException
mvccAllVersionsCursor in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.x - Implementation specific argument, null always means that we need to return full detached data row.IgniteCheckedException - If failed.public CacheDataRow mvccFind(GridCacheContext cctx, KeyCacheObject key, MvccSnapshot snapshot) throws IgniteCheckedException
mvccFind in interface IgniteCacheOffheapManager.CacheDataStorecctx - Cache context.key - Key.IgniteCheckedException - If failed.public GridCursor<? extends CacheDataRow> cursor() throws IgniteCheckedException
cursor in interface IgniteCacheOffheapManager.CacheDataStoreIgniteCheckedException - If failed.public GridCursor<? extends CacheDataRow> cursor(Object x) throws IgniteCheckedException
cursor in interface IgniteCacheOffheapManager.CacheDataStorex - Implementation specific argument, null always means that we need to return full detached data row.IgniteCheckedException - If failed.public GridCursor<? extends CacheDataRow> cursor(MvccSnapshot mvccSnapshot) throws IgniteCheckedException
cursor in interface IgniteCacheOffheapManager.CacheDataStoremvccSnapshot - MVCC snapshot.IgniteCheckedException - If failed.public GridCursor<? extends CacheDataRow> cursor(int cacheId) throws IgniteCheckedException
cursor in interface IgniteCacheOffheapManager.CacheDataStorecacheId - Cache ID.IgniteCheckedException - If failed.public GridCursor<? extends CacheDataRow> cursor(int cacheId, MvccSnapshot mvccSnapshot) throws IgniteCheckedException
cursor in interface IgniteCacheOffheapManager.CacheDataStorecacheId - Cache ID.mvccSnapshot - Mvcc snapshot.IgniteCheckedException - If failed.public GridCursor<? extends CacheDataRow> cursor(int cacheId, KeyCacheObject lower, KeyCacheObject upper) throws IgniteCheckedException
cursor in interface IgniteCacheOffheapManager.CacheDataStorecacheId - Cache ID.lower - Lower bound.upper - Upper bound.IgniteCheckedException - If failed.public GridCursor<? extends CacheDataRow> cursor(int cacheId, KeyCacheObject lower, KeyCacheObject upper, Object x) throws IgniteCheckedException
cursor in interface IgniteCacheOffheapManager.CacheDataStorecacheId - Cache ID.lower - Lower bound.upper - Upper bound.x - Implementation specific argument, null always means that we need to return full detached data row.IgniteCheckedException - If failed.public GridCursor<? extends CacheDataRow> cursor(int cacheId, KeyCacheObject lower, KeyCacheObject upper, Object x, MvccSnapshot snapshot) throws IgniteCheckedException
cursor in interface IgniteCacheOffheapManager.CacheDataStorecacheId - Cache ID.lower - Lower bound.upper - Upper bound.x - Implementation specific argument, null always means that we need to return full detached data row.snapshot - Mvcc snapshot.IgniteCheckedException - If failed.public void destroy()
throws IgniteCheckedException
destroy in interface IgniteCacheOffheapManager.CacheDataStoreIgniteCheckedException - If failed.public void markDestroyed()
markDestroyed in interface IgniteCacheOffheapManager.CacheDataStorepublic void clear(int cacheId)
throws IgniteCheckedException
clear in interface IgniteCacheOffheapManager.CacheDataStorecacheId - Cache ID.IgniteCheckedException - If failed.public RowStore rowStore()
rowStore in interface IgniteCacheOffheapManager.CacheDataStorepublic void setRowCacheCleaner(GridQueryRowCacheCleaner rowCacheCleaner)
setRowCacheCleaner in interface IgniteCacheOffheapManager.CacheDataStorerowCacheCleaner - Rows cache cleaner.public void restoreState(long size,
long updCntr,
@Nullable
@Nullable Map<Integer,Long> cacheSizes,
byte[] cntrUpdData)
size - Size to init.updCntr - Update counter.cacheSizes - Cache sizes if store belongs to group containing multiple caches.cntrUpdData - Counter updates.public PendingEntriesTree pendingTree()
pendingTree in interface IgniteCacheOffheapManager.CacheDataStorepublic void preload()
throws IgniteCheckedException
preload in interface IgniteCacheOffheapManager.CacheDataStoreIgniteCheckedException - If failed.public void resetUpdateCounter()
resetUpdateCounter in interface IgniteCacheOffheapManager.CacheDataStorepublic void resetInitialUpdateCounter()
resetInitialUpdateCounter in interface IgniteCacheOffheapManager.CacheDataStorepublic PartitionMetaStorage<SimpleDataRow> partStorage()
partStorage in interface IgniteCacheOffheapManager.CacheDataStore
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.1 Release Date : December 9 2020