public abstract class AbstractFreeList<T extends Storable> extends PagesList implements FreeList<T>, ReuseList
PagesList.PagesCache, PagesList.StripebucketsSize, changed, DFLT_PAGES_LIST_TRY_LOCK_ATTEMPTS, IGNITE_PAGES_LIST_STRIPES_PER_BUCKET, IGNITE_PAGES_LIST_TRY_LOCK_ATTEMPTS, log, name, pageCacheChanged| Constructor and Description |
|---|
AbstractFreeList(int cacheGrpId,
String name,
DataRegion dataRegion,
ReuseList reuseList,
IgniteWriteAheadLogManager wal,
long metaPageId,
boolean initNew,
PageLockListener lockLsnr,
GridKernalContext ctx,
AtomicLong pageListCacheLimit,
byte pageFlag) |
| Modifier and Type | Method and Description |
|---|---|
void |
addForRecycle(ReuseBag bag) |
protected boolean |
casBucket(int bucket,
PagesList.Stripe[] exp,
PagesList.Stripe[] upd) |
void |
dumpStatistics(IgniteLogger log) |
int |
emptyDataPages() |
long |
freeSpace()
Calculates free space tracked by this FreeListImpl instance.
|
protected PagesList.Stripe[] |
getBucket(int bucket) |
protected PagesList.PagesCache |
getBucketCache(int bucket,
boolean create) |
protected int |
getBucketIndex(int freeSpace)
Gets bucket index by page freespace.
|
long |
initRecycledPage(long pageId,
byte flag,
PageIO initIO)
Converts recycled page id back to a usable id.
|
void |
insertDataRow(T row,
IoStatisticsHolder statHolder) |
void |
insertDataRows(Collection<T> rows,
IoStatisticsHolder statHolder)
Reduces the workload on the free list by writing multiple rows into a single memory page at once.
|
protected boolean |
isReuseBucket(int bucket) |
long |
recycledPagesCount() |
void |
removeDataRowByLink(long link,
IoStatisticsHolder statHolder) |
long |
takeRecycledPage() |
String |
toString() |
<S,R> R |
updateDataRow(long link,
PageHandler<S,R> pageHnd,
S arg,
IoStatisticsHolder statHolder) |
boolean |
updateDataRow(long link,
T row,
IoStatisticsHolder statHolder) |
bucketsCount, bucketSize, cachedPagesCount, init, initRecycledPage0, initReusedPage, name, put, removeDataPage, saveMetadata, storedPagesCount, stripesCount, takeEmptyPageacquirePage, allocatePage, allocatePage, allocatePageNoReuse, groupId, init, needWalDeltaRecord, pageSize, randomInt, read, read, readLock, readUnlock, recyclePage, releasePage, tryWriteLock, write, write, write, write, writeLock, writeUnlock, writeUnlockpublic AbstractFreeList(int cacheGrpId,
String name,
DataRegion dataRegion,
ReuseList reuseList,
IgniteWriteAheadLogManager wal,
long metaPageId,
boolean initNew,
PageLockListener lockLsnr,
GridKernalContext ctx,
AtomicLong pageListCacheLimit,
byte pageFlag)
throws IgniteCheckedException
cacheGrpId - Cache group ID.name - Name (for debug purpose).dataRegion - Data region.reuseList - Reuse list or null if this free list will be a reuse list for itself.wal - Write ahead log manager.metaPageId - Metadata page ID.initNew - True if new metadata should be initialized.pageFlag - Default flag value for allocated pages.IgniteCheckedException - If failed.public long freeSpace()
public void dumpStatistics(IgniteLogger log)
dumpStatistics in interface FreeList<T extends Storable>log - Logger.protected int getBucketIndex(int freeSpace)
getBucketIndex in class PagesListpublic void insertDataRow(T row, IoStatisticsHolder statHolder) throws IgniteCheckedException
insertDataRow in interface FreeList<T extends Storable>row - Row.statHolder - Statistics holder to track IO operations.IgniteCheckedException - If failed.public void insertDataRows(Collection<T> rows, IoStatisticsHolder statHolder) throws IgniteCheckedException
insertDataRows in interface FreeList<T extends Storable>rows - Rows.statHolder - Statistics holder to track IO operations.IgniteCheckedException - If failed.public boolean updateDataRow(long link,
T row,
IoStatisticsHolder statHolder)
throws IgniteCheckedException
updateDataRow in interface FreeList<T extends Storable>link - Row link.row - New row data.statHolder - Statistics holder to track IO operations.True if was able to update row.IgniteCheckedException - If failed.public <S,R> R updateDataRow(long link,
PageHandler<S,R> pageHnd,
S arg,
IoStatisticsHolder statHolder)
throws IgniteCheckedException
updateDataRow in interface FreeList<T extends Storable>S - Argument type.R - Result type.link - Row link.pageHnd - Page handler.arg - Handler argument.statHolder - Statistics holder to track IO operations.IgniteCheckedException - If failed.public void removeDataRowByLink(long link,
IoStatisticsHolder statHolder)
throws IgniteCheckedException
removeDataRowByLink in interface FreeList<T extends Storable>link - Row link.statHolder - Statistics holder to track IO operations.IgniteCheckedException - If failed.protected PagesList.Stripe[] getBucket(int bucket)
protected boolean casBucket(int bucket,
PagesList.Stripe[] exp,
PagesList.Stripe[] upd)
protected boolean isReuseBucket(int bucket)
isReuseBucket in class PagesListbucket - Bucket index.true If it is a reuse bucket.protected PagesList.PagesCache getBucketCache(int bucket, boolean create)
getBucketCache in class PagesListbucket - Bucket index.public int emptyDataPages()
public void addForRecycle(ReuseBag bag) throws IgniteCheckedException
addForRecycle in interface ReuseListbag - Reuse bag.IgniteCheckedException - If failed.public long takeRecycledPage()
throws IgniteCheckedException
takeRecycledPage in interface ReuseList0 if none available.IgniteCheckedException - If failed.public long initRecycledPage(long pageId,
byte flag,
PageIO initIO)
throws IgniteCheckedException
initRecycledPage in interface ReuseListpageId - Id of the recycled page.flag - Flag value for the page. One of PageIdAllocator.FLAG_DATA, PageIdAllocator.FLAG_IDX
or PageIdAllocator.FLAG_AUX.initIO - Page IO to reinit reused page.IgniteCheckedException - If failed.FullPageIdpublic long recycledPagesCount()
throws IgniteCheckedException
recycledPagesCount in interface ReuseListIgniteCheckedException - If failed.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.0 Release Date : September 11 2021