public class PageMemoryNoStoreImpl extends Object implements PageMemory
+--------+--------+---------------------------------------------+ |8 bytes |8 bytes | PAGE_SIZE + PAGE_OVERHEAD - 16 bytes | +--------+--------+---------------------------------------------+ |Next ptr|Rel ptr | Empty | +--------+--------+---------------------------------------------+When page is allocated and is in use:
+--------+--------+--------+--------+---------------------------+ |8 bytes |8 bytes |8 bytes |8 bytes | PAGE_SIZE | +--------+--------+--------+--------+---------------------------+ | Marker |Page ID |Pin CNT | Lock | Page data | +--------+--------+--------+--------+---------------------------+Note that first 8 bytes of page header are used either for page marker or for next relative pointer depending on whether the page is in use or not.
| Modifier and Type | Field and Description |
|---|---|
static int |
LOCK_OFFSET
Page pin counter offset.
|
static int |
PAGE_ID_OFFSET
Page ID offset.
|
static long |
PAGE_MARKER |
static int |
PAGE_OVERHEAD
Need a 8-byte pointer for linked list, 8 bytes for internal needs (flags),
4 bytes cache ID, 8 bytes timestamp.
|
FLAG_DATA, FLAG_IDX, INDEX_PARTITION, MAX_PARTITION_ID| Constructor and Description |
|---|
PageMemoryNoStoreImpl(IgniteLogger log,
DirectMemoryProvider directMemoryProvider,
GridCacheSharedContext<?,?> sharedCtx,
int pageSize,
DataRegionConfiguration dataRegionCfg,
DataRegionMetricsImpl memMetrics,
boolean trackAcquiredPages) |
| Modifier and Type | Method and Description |
|---|---|
long |
acquiredPages() |
long |
acquirePage(int cacheId,
long pageId)
Gets the page absolute pointer associated with the given page ID.
|
long |
allocatePage(int cacheId,
int partId,
byte flags)
Allocates a page from the space for the given partition ID and the given flags.
|
int |
checkpointBufferPagesCount()
Number of pages used in checkpoint buffer.
|
boolean |
freePage(int cacheId,
long pageId)
The given page is free now.
|
boolean |
isDirty(int cacheId,
long pageId,
long page) |
long |
loadedPages() |
ByteBuffer |
pageBuffer(long pageAddr) |
int |
pageIndex(int seqNo) |
int |
pageSequenceNumber(int pageIdx) |
int |
pageSize() |
long |
readLock(int cacheId,
long pageId,
long page) |
long |
readLockForce(int cacheId,
long pageId,
long page)
Obtains read lock without checking page tag.
|
void |
readUnlock(int cacheId,
long pageId,
long page)
Releases locked page.
|
void |
releasePage(int cacheId,
long pageId,
long page) |
void |
start()
Starts grid component, called on grid start.
|
void |
stop()
Stops grid component, called on grid shutdown.
|
int |
systemPageSize() |
int |
totalPages() |
long |
tryWriteLock(int cacheId,
long pageId,
long page) |
long |
writeLock(int cacheId,
long pageId,
long page) |
void |
writeUnlock(int cacheId,
long pageId,
long page,
Boolean walPlc,
boolean dirtyFlag)
Releases locked page.
|
public static final long PAGE_MARKER
public static final int PAGE_ID_OFFSET
public static final int LOCK_OFFSET
public static final int PAGE_OVERHEAD
public PageMemoryNoStoreImpl(IgniteLogger log, DirectMemoryProvider directMemoryProvider, GridCacheSharedContext<?,?> sharedCtx, int pageSize, DataRegionConfiguration dataRegionCfg, DataRegionMetricsImpl memMetrics, boolean trackAcquiredPages)
log - Logger.directMemoryProvider - Memory allocator to use.sharedCtx - Cache shared context.pageSize - Page size.dataRegionCfg - Data region configuration.memMetrics - Memory Metrics.trackAcquiredPages - If true tracks number of allocated pages (for tests purpose only).public void start()
throws IgniteException
start in interface LifecycleAwareIgniteException - If failed.public void stop()
throws IgniteException
stop in interface LifecycleAwareIgniteException - If failed.public ByteBuffer pageBuffer(long pageAddr)
pageBuffer in interface PageMemorypageAddr - Page address.public long allocatePage(int cacheId,
int partId,
byte flags)
allocatePage in interface PageIdAllocatorpartId - Partition ID.public boolean freePage(int cacheId,
long pageId)
freePage in interface PageIdAllocatorcacheId - Cache ID.pageId - Page ID.public int pageSize()
pageSize in interface PageMemorypublic int systemPageSize()
systemPageSize in interface PageMemorypublic long loadedPages()
loadedPages in interface PageMemorypublic int totalPages()
public long acquiredPages()
public long acquirePage(int cacheId,
long pageId)
PageSupport.releasePage(int, long, long). This method will allocate page with given ID if it doesn't
exist.acquirePage in interface PageSupportcacheId - Cache group ID.pageId - Page ID.public void releasePage(int cacheId,
long pageId,
long page)
releasePage in interface PageSupportcacheId - Cache group ID.pageId - Page ID to release.page - Page pointer.public long readLock(int cacheId,
long pageId,
long page)
readLock in interface PageSupportcacheId - Cache group ID.pageId - Page ID.page - Page pointer.public long readLockForce(int cacheId,
long pageId,
long page)
readLockForce in interface PageSupportcacheId - Cache group ID.pageId - Page ID.page - Page pointer.public void readUnlock(int cacheId,
long pageId,
long page)
readUnlock in interface PageSupportcacheId - Cache group ID.pageId - Page ID.page - Page pointer.public long writeLock(int cacheId,
long pageId,
long page)
writeLock in interface PageSupportcacheId - Cache group ID.pageId - Page ID.page - Page pointer.0L if attempt to take the write lock failed.public long tryWriteLock(int cacheId,
long pageId,
long page)
tryWriteLock in interface PageSupportcacheId - Cache group ID.pageId - Page ID.page - Page pointer.0L if attempt to take the write lock failed.public void writeUnlock(int cacheId,
long pageId,
long page,
Boolean walPlc,
boolean dirtyFlag)
writeUnlock in interface PageSupportcacheId - Cache group ID.pageId - Page ID.page - Page pointer.walPlc - True if page should be recorded to WAL, false if the page must not
be recorded and null for the default behavior.dirtyFlag - Determines whether the page was modified since the last checkpoint.public boolean isDirty(int cacheId,
long pageId,
long page)
isDirty in interface PageSupportcacheId - Cache group ID.pageId - Page ID.page - Page pointer.True if the page is dirty.public int pageSequenceNumber(int pageIdx)
pageIdx - Page index.public int pageIndex(int seqNo)
seqNo - Page sequence number.public int checkpointBufferPagesCount()
checkpointBufferPagesCount in interface PageMemory
Follow @ApacheIgnite
Ignite Fabric : ver. 2.4.0 Release Date : March 5 2018