public abstract class AbstractFreeList<T extends Storable> extends PagesList implements FreeList<T>, ReuseList
PagesList.PagesCache, PagesList.StripebucketsSize, changed, log, name| Constructor and Description |
|---|
AbstractFreeList(int cacheId,
String name,
DataRegionMetricsImpl memMetrics,
DataRegion memPlc,
ReuseList reuseList,
IgniteWriteAheadLogManager wal,
long metaPageId,
boolean initNew,
PageLockListener lockLsnr,
GridKernalContext ctx,
AtomicLong pageListCacheLimit) |
| 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.
|
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, 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 cacheId,
String name,
DataRegionMetricsImpl memMetrics,
DataRegion memPlc,
ReuseList reuseList,
IgniteWriteAheadLogManager wal,
long metaPageId,
boolean initNew,
PageLockListener lockLsnr,
GridKernalContext ctx,
AtomicLong pageListCacheLimit)
throws IgniteCheckedException
cacheId - Cache ID.name - Name (for debug purpose).memMetrics - Memory metrics.memPlc - 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.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 recycledPagesCount()
throws IgniteCheckedException
recycledPagesCount in interface ReuseListIgniteCheckedException - If failed.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.8.0 Release Date : February 27 2020