Class PagePool
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.pagemem.PagePool
-
public class PagePool extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected longfreePageListPtrPointer to the address of the free page list.protected intidxSegment index.protected longlastAllocatedIdxPtrprotected longpagesBasePages base.protected AtomicIntegerpagesCntrPool pages counter.protected DirectMemoryRegionregionDirect memory region.
-
Constructor Summary
Constructors Modifier Constructor Description protectedPagePool(int idx, DirectMemoryRegion region, int sysPageSize, OffheapReadWriteLock rwLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longborrowOrAllocateFreePage(int tag)Allocates a new free page.intpages()intreleaseFreePage(long relPtr)intsize()
-
-
-
Field Detail
-
idx
protected final int idx
Segment index.
-
region
protected final DirectMemoryRegion region
Direct memory region.
-
pagesCntr
protected final AtomicInteger pagesCntr
Pool pages counter.
-
lastAllocatedIdxPtr
protected long lastAllocatedIdxPtr
-
freePageListPtr
protected long freePageListPtr
Pointer to the address of the free page list.
-
pagesBase
protected long pagesBase
Pages base.
-
-
Constructor Detail
-
PagePool
protected PagePool(int idx, DirectMemoryRegion region, int sysPageSize, OffheapReadWriteLock rwLock)- Parameters:
idx- Index.region- Region
-
-
Method Detail
-
borrowOrAllocateFreePage
public long borrowOrAllocateFreePage(int tag) throws GridOffHeapOutOfMemoryExceptionAllocates a new free page.- Parameters:
tag- Tag to initialize page RW lock.- Returns:
- Relative pointer to the allocated page.
- Throws:
GridOffHeapOutOfMemoryException- If failed to allocate new free page.
-
releaseFreePage
public int releaseFreePage(long relPtr)
- Parameters:
relPtr- Relative pointer to free.- Returns:
- Resulting number of pages in pool if pages counter is enabled, 0 otherwise.
-
pages
public int pages()
- Returns:
- Max number of pages in the pool.
-
size
public int size()
- Returns:
- Number of pages in the list.
-
-