public abstract class DataStructure extends Object
PageMemory.| Modifier and Type | Field and Description |
|---|---|
protected int |
grpId |
protected String |
grpName |
protected PageMetrics |
metrics |
protected byte |
pageFlag |
protected PageIoResolver |
pageIoRslvr |
protected PageMemory |
pageMem |
protected ReuseList |
reuseList |
static Random |
rnd
For tests.
|
protected @Nullable IgniteWriteAheadLogManager |
wal |
| Constructor and Description |
|---|
DataStructure(String name,
int cacheGrpId,
@Nullable String grpName,
PageMemory pageMem,
@Nullable IgniteWriteAheadLogManager wal,
PageLockTrackerManager pageLockTrackerManager,
PageIoResolver pageIoRslvr,
byte pageFlag) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
acquirePage(long pageId,
IoStatisticsHolder statHolder) |
protected long |
allocatePage(ReuseBag bag)
Shorthand for
allocatePage(bag, true). |
protected long |
allocatePage(ReuseBag bag,
boolean useRecycled) |
protected long |
allocatePageNoReuse() |
void |
close()
Frees the resources allocated by this structure.
|
int |
groupId() |
protected void |
init(long pageId,
PageIO init) |
String |
name() |
protected boolean |
needWalDeltaRecord(long pageId,
long page,
Boolean walPlc) |
protected int |
pageSize() |
static int |
randomInt(int max) |
protected <X,R> R |
read(long pageId,
long page,
PageHandler<X,R> h,
X arg,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder) |
protected <X,R> R |
read(long pageId,
PageHandler<X,R> h,
X arg,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder) |
protected long |
readLock(long pageId,
long page) |
protected void |
readUnlock(long pageId,
long page,
long pageAddr) |
protected long |
recyclePage(long pageId,
long page,
long pageAddr,
Boolean walPlc) |
protected void |
releasePage(long pageId,
long page) |
protected long |
tryWriteLock(long pageId,
long page) |
protected <X,R> R |
write(long pageId,
long page,
PageHandler<X,R> h,
X arg,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder) |
protected <R> R |
write(long pageId,
PageHandler<?,R> h,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder) |
protected <X,R> R |
write(long pageId,
PageHandler<X,R> h,
PageIO init,
X arg,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder) |
protected <X,R> R |
write(long pageId,
PageHandler<X,R> h,
X arg,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder) |
protected long |
writeLock(long pageId,
long page) |
protected void |
writeUnlock(long pageId,
long page,
long pageAddr,
boolean dirty)
Note: Default WAL record policy will be used.
|
protected void |
writeUnlock(long pageId,
long page,
long pageAddr,
Boolean walPlc,
boolean dirty) |
public static Random rnd
protected final int grpId
protected final String grpName
protected final PageMemory pageMem
@Nullable protected final @Nullable IgniteWriteAheadLogManager wal
protected ReuseList reuseList
protected final PageIoResolver pageIoRslvr
protected final byte pageFlag
protected final PageMetrics metrics
public DataStructure(String name, int cacheGrpId, @Nullable @Nullable String grpName, PageMemory pageMem, @Nullable @Nullable IgniteWriteAheadLogManager wal, PageLockTrackerManager pageLockTrackerManager, PageIoResolver pageIoRslvr, byte pageFlag)
name - Structure name (for debugging purposes).cacheGrpId - Cache group id.grpName - Group name.pageMem - Page memory.wal - Write ahead log manager.pageLockTrackerManager - Page lock tracker manager.pageIoRslvr - Page IO resolver.pageFlag - Default flag value for allocated pages.public final String name()
public final int groupId()
public static int randomInt(int max)
max - Max.0 (inclusive) to the given max value (exclusive).protected final long allocatePage(ReuseBag bag) throws IgniteCheckedException
allocatePage(bag, true).bag - Reuse bag.IgniteCheckedException - If failed.protected final long allocatePage(ReuseBag bag, boolean useRecycled) throws IgniteCheckedException
bag - Reuse Bag.useRecycled - Use recycled page.IgniteCheckedException - If failed.protected long allocatePageNoReuse()
throws IgniteCheckedException
IgniteCheckedException - If failed.protected final long acquirePage(long pageId,
IoStatisticsHolder statHolder)
throws IgniteCheckedException
pageId - Page ID.statHolder - Statistics holder to track IO operations.IgniteCheckedException - If failed.protected final void releasePage(long pageId,
long page)
pageId - Page ID.page - Page pointer.protected final long tryWriteLock(long pageId,
long page)
pageId - Page IDpage - Page pointer.0 if failed to lock due to recycling.protected final long writeLock(long pageId,
long page)
pageId - Page IDpage - Page pointer.protected final void writeUnlock(long pageId,
long page,
long pageAddr,
boolean dirty)
Note: Default WAL record policy will be used.
pageId - Page IDpage - Page pointer.pageAddr - Page address.dirty - Dirty flag.protected final long readLock(long pageId,
long page)
pageId - Page IDpage - Page pointer.protected final void readUnlock(long pageId,
long page,
long pageAddr)
pageId - Page IDpage - Page pointer.pageAddr - Page address.protected final void writeUnlock(long pageId,
long page,
long pageAddr,
Boolean walPlc,
boolean dirty)
pageId - Page IDpage - Page pointer.pageAddr - Page address.walPlc - Full page WAL record policy.dirty - Dirty flag.protected final boolean needWalDeltaRecord(long pageId,
long page,
Boolean walPlc)
pageId - Page ID.page - Page pointer.walPlc - Full page WAL record policy.true If we need to make a delta WAL record for the change in this page.protected final <R> R write(long pageId,
PageHandler<?,R> h,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder)
throws IgniteCheckedException
pageId - Page ID.h - Handler.intArg - Argument of type int.lockFailed - Result in case of lock failure due to page recycling.statHolder - Statistics holder to track IO operations.IgniteCheckedException - If failed.protected final <X,R> R write(long pageId,
PageHandler<X,R> h,
X arg,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder)
throws IgniteCheckedException
pageId - Page ID.h - Handler.arg - Argument.intArg - Argument of type int.lockFailed - Result in case of lock failure due to page recycling.statHolder - Statistics holder to track IO operations.IgniteCheckedException - If failed.protected final <X,R> R write(long pageId,
long page,
PageHandler<X,R> h,
X arg,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder)
throws IgniteCheckedException
pageId - Page ID.page - Page pointer.h - Handler.arg - Argument.intArg - Argument of type int.lockFailed - Result in case of lock failure due to page recycling.statHolder - Statistics holder to track IO operations.IgniteCheckedException - If failed.protected final <X,R> R write(long pageId,
PageHandler<X,R> h,
PageIO init,
X arg,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder)
throws IgniteCheckedException
pageId - Page ID.h - Handler.init - IO for new page initialization or null if it is an existing page.arg - Argument.intArg - Argument of type int.lockFailed - Result in case of lock failure due to page recycling.statHolder - Statistics holder to track IO operations.IgniteCheckedException - If failed.protected final <X,R> R read(long pageId,
PageHandler<X,R> h,
X arg,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder)
throws IgniteCheckedException
pageId - Page ID.h - Handler.arg - Argument.intArg - Argument of type int.lockFailed - Result in case of lock failure due to page recycling.statHolder - Statistics holder to track IO operations.IgniteCheckedException - If failed.protected final <X,R> R read(long pageId,
long page,
PageHandler<X,R> h,
X arg,
int intArg,
R lockFailed,
IoStatisticsHolder statHolder)
throws IgniteCheckedException
pageId - Page ID.page - Page pointer.h - Handler.arg - Argument.intArg - Argument of type int.lockFailed - Result in case of lock failure due to page recycling.statHolder - Statistics holder to track IO operations.IgniteCheckedException - If failed.protected final void init(long pageId,
PageIO init)
throws IgniteCheckedException
pageId - Page ID.init - IO for new page initialization.IgniteCheckedException - if failed.protected final long recyclePage(long pageId,
long page,
long pageAddr,
Boolean walPlc)
throws IgniteCheckedException
pageId - Page ID.page - Page pointer.pageAddr - Page address.walPlc - Full page WAL record policy.IgniteCheckedException - If failed.protected int pageSize()
public void close()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023