public abstract class DataStructure extends Object
PageMemory.| Modifier and Type | Field and Description |
|---|---|
protected int |
grpId |
protected String |
grpName |
protected PageLockListener |
lockLsnr |
static PageLockListener |
NOOP_LSNR
No-op page lock listener.
|
protected PageMemory |
pageMem |
protected ReuseList |
reuseList |
static Random |
rnd
For tests.
|
protected IgniteWriteAheadLogManager |
wal |
| Constructor and Description |
|---|
DataStructure(int cacheGrpId,
String grpName,
PageMemory pageMem,
IgniteWriteAheadLogManager wal,
PageLockListener lockLsnr) |
| 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() |
int |
groupId() |
protected void |
init(long pageId,
PageIO init) |
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
protected final IgniteWriteAheadLogManager wal
protected final PageLockListener lockLsnr
protected ReuseList reuseList
public static final PageLockListener NOOP_LSNR
public DataStructure(int cacheGrpId,
String grpName,
PageMemory pageMem,
IgniteWriteAheadLogManager wal,
PageLockListener lockLsnr)
cacheGrpId - Cache group ID.grpName - Cache group name.pageMem - Page memory.wal - Write ahead log manager.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()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.0 Release Date : October 15 2020