Interface IgniteCacheOffheapManager.CacheDataStore
-
- All Known Implementing Classes:
GridCacheOffheapManager.GridCacheDataStore,IgniteCacheOffheapManagerImpl.CacheDataStoreImpl
- Enclosing interface:
- IgniteCacheOffheapManager
public static interface IgniteCacheOffheapManager.CacheDataStore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longcacheSize(int cacheId)Map<Integer,Long>cacheSizes()voidclear(int cacheId)Clears all the records associated with logical cache with given ID.CacheDataRowcreateRow(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(Object x)voiddestroy()Destroys the tree associated with the store.booleandestroyed()GridLongListfinalizeUpdateCounters()Flushes pending update counters closing all possible gaps.CacheDataRowfind(GridCacheContext cctx, KeyCacheObject key)longfullSize()longgetAndIncrementUpdateCounter(long delta)Returns current value and updates counter by delta.longhighestAppliedCounter()booleaninit()Initialize data store if it exists.longinitialUpdateCounter()voidinsertRows(Collection<DataRowCacheAware> rows, IgnitePredicateX<CacheDataRow> initPred)Insert rows into page memory.voidinvoke(GridCacheContext cctx, KeyCacheObject key, IgniteCacheOffheapManager.OffheapInvokeClosure c)booleanisEmpty()voidmarkDestroyed()Mark store as destroyed.longnextUpdateCounter()intpartId()PartitionMetaStorage<SimpleDataRow>partStorage()Partition storage.@Nullable PartitionUpdateCounterpartUpdateCounter()PendingEntriesTreependingTree()Return PendingTree for data store.voidpreload()Preload a store into page memory.voidremove(GridCacheContext cctx, KeyCacheObject key, int partId)longreserve(long delta)longreservedCounter()voidresetInitialUpdateCounter()Reset the initial value of the partition counter.voidresetUpdateCounter()Reset counter for partition.RowStorerowStore()voidsetRowCacheCleaner(GridQueryRowCacheCleaner rowCacheCleaner)Inject rows cache cleaner.CacheDataTreetree()voidupdate(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, @Nullable CacheDataRow oldRow)longupdateCounter()voidupdateCounter(long val)booleanupdateCounter(long start, long delta)Updates counters from start value by delta value.voidupdateInitialCounter(long start, long delta)voidupdateSize(int cacheId, long delta)Updates size metric for particular cache.
-
-
-
Method Detail
-
tree
CacheDataTree tree()
- Returns:
- Cache data tree object.
-
init
boolean init()
Initialize data store if it exists.- Returns:
Trueif initialized.
-
partId
int partId()
- Returns:
- Partition ID.
-
cacheSize
long cacheSize(int cacheId)
- Parameters:
cacheId- Cache ID.- Returns:
- Size.
-
cacheSizes
Map<Integer,Long> cacheSizes()
- Returns:
- Cache sizes if store belongs to group containing multiple caches.
-
fullSize
long fullSize()
- Returns:
- Total size.
-
isEmpty
boolean isEmpty()
- Returns:
Trueif there are no items in the store.
-
updateSize
void updateSize(int cacheId, long delta)Updates size metric for particular cache.- Parameters:
cacheId- Cache ID.delta- Size delta.
-
updateCounter
long updateCounter()
- Returns:
- Update counter (LWM).
-
highestAppliedCounter
long highestAppliedCounter()
- Returns:
- Highest applied update counter.
-
reservedCounter
long reservedCounter()
- Returns:
- Reserved counter (HWM).
-
partUpdateCounter
@Nullable @Nullable PartitionUpdateCounter partUpdateCounter()
- Returns:
- Update counter or
nullif store is not yet created.
-
reserve
long reserve(long delta)
- Parameters:
delta- Delta.
-
updateCounter
void updateCounter(long val)
- Parameters:
val- Update counter.
-
updateCounter
boolean updateCounter(long start, long delta)Updates counters from start value by delta value.- Parameters:
start- Start.delta- Delta.
-
nextUpdateCounter
long nextUpdateCounter()
- Returns:
- Next update counter.
-
getAndIncrementUpdateCounter
long getAndIncrementUpdateCounter(long delta)
Returns current value and updates counter by delta.- Parameters:
delta- Delta.- Returns:
- Current value.
-
initialUpdateCounter
long initialUpdateCounter()
- Returns:
- Initial update counter.
-
createRow
CacheDataRow createRow(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, @Nullable @Nullable CacheDataRow oldRow) throws IgniteCheckedException
- Parameters:
cctx- Cache context.key- Key.val- Value.ver- Version.expireTime- Expire time.oldRow- Old row.- Returns:
- New row.
- Throws:
IgniteCheckedException- If failed.
-
insertRows
void insertRows(Collection<DataRowCacheAware> rows, IgnitePredicateX<CacheDataRow> initPred) throws IgniteCheckedException
Insert rows into page memory.- Parameters:
rows- Rows.initPred- Applied to all rows. Each row that not matches the predicate is removed.- Throws:
IgniteCheckedException- If failed.
-
update
void update(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, @Nullable @Nullable CacheDataRow oldRow) throws IgniteCheckedException
- Parameters:
cctx- Cache context.key- Key.val- Value.ver- Version.expireTime- Expire time.oldRow- Old row if available.- Throws:
IgniteCheckedException- If failed.
-
invoke
void invoke(GridCacheContext cctx, KeyCacheObject key, IgniteCacheOffheapManager.OffheapInvokeClosure c) throws IgniteCheckedException
- Parameters:
cctx- Cache context.key- Key.c- Closure.- Throws:
IgniteCheckedException- If failed.
-
remove
void remove(GridCacheContext cctx, KeyCacheObject key, int partId) throws IgniteCheckedException
- Parameters:
cctx- Cache context.key- Key.partId- Partition number.- Throws:
IgniteCheckedException- If failed.
-
find
CacheDataRow find(GridCacheContext cctx, KeyCacheObject key) throws IgniteCheckedException
- Parameters:
cctx- Cache context.key- Key.- Returns:
- Data row.
- Throws:
IgniteCheckedException- If failed.
-
cursor
GridCursor<? extends CacheDataRow> cursor() throws IgniteCheckedException
- Returns:
- Data cursor.
- Throws:
IgniteCheckedException- If failed.
-
cursor
GridCursor<? extends CacheDataRow> cursor(Object x) throws IgniteCheckedException
- Parameters:
x- Implementation specific argument,nullalways means that we need to return full detached data row.- Returns:
- Data cursor.
- Throws:
IgniteCheckedException- If failed.
-
cursor
GridCursor<? extends CacheDataRow> cursor(int cacheId) throws IgniteCheckedException
- Parameters:
cacheId- Cache ID.- Returns:
- Data cursor.
- Throws:
IgniteCheckedException- If failed.
-
cursor
GridCursor<? extends CacheDataRow> cursor(int cacheId, KeyCacheObject lower, KeyCacheObject upper) throws IgniteCheckedException
- Parameters:
cacheId- Cache ID.lower- Lower bound.upper- Upper bound.- Returns:
- Data cursor.
- Throws:
IgniteCheckedException- If failed.
-
cursor
GridCursor<? extends CacheDataRow> cursor(int cacheId, KeyCacheObject lower, KeyCacheObject upper, Object x) throws IgniteCheckedException
- Parameters:
cacheId- Cache ID.lower- Lower bound.upper- Upper bound.x- Implementation specific argument,nullalways means that we need to return full detached data row.- Returns:
- Data cursor.
- Throws:
IgniteCheckedException- If failed.
-
destroy
void destroy() throws IgniteCheckedExceptionDestroys the tree associated with the store.- Throws:
IgniteCheckedException- If failed.
-
markDestroyed
void markDestroyed() throws IgniteCheckedExceptionMark store as destroyed.- Throws:
IgniteCheckedException
-
destroyed
boolean destroyed()
- Returns:
trueIf marked as destroyed.
-
clear
void clear(int cacheId) throws IgniteCheckedExceptionClears all the records associated with logical cache with given ID.- Parameters:
cacheId- Cache ID.- Throws:
IgniteCheckedException- If failed.
-
rowStore
RowStore rowStore()
- Returns:
- Row store.
-
updateInitialCounter
void updateInitialCounter(long start, long delta)- Parameters:
start- Counter.delta- Delta.
-
setRowCacheCleaner
void setRowCacheCleaner(GridQueryRowCacheCleaner rowCacheCleaner)
Inject rows cache cleaner.- Parameters:
rowCacheCleaner- Rows cache cleaner.
-
pendingTree
PendingEntriesTree pendingTree()
Return PendingTree for data store.- Returns:
- PendingTree instance.
-
finalizeUpdateCounters
GridLongList finalizeUpdateCounters()
Flushes pending update counters closing all possible gaps.- Returns:
- Even-length array of pairs [start, end] for each gap.
-
preload
void preload() throws IgniteCheckedExceptionPreload a store into page memory.- Throws:
IgniteCheckedException- If failed.
-
resetUpdateCounter
void resetUpdateCounter()
Reset counter for partition.
-
resetInitialUpdateCounter
void resetInitialUpdateCounter()
Reset the initial value of the partition counter.
-
partStorage
PartitionMetaStorage<SimpleDataRow> partStorage()
Partition storage.
-
-