use of org.apache.ignite.internal.processors.cache.persistence.tree.reuse.ReuseListImpl in project ignite by apache.
the class WalRecoveryTxLogicalRecordsTest method getReuseListData.
/**
* @param ignite Node.
* @param cacheName Cache name.
* @return Cache reuse list data.
*/
private T2<long[], Integer> getReuseListData(Ignite ignite, String cacheName) {
GridCacheContext ctx = ((IgniteEx) ignite).context().cache().cache(cacheName).context();
ReuseListImpl reuseList = GridTestUtils.getFieldValue(ctx.offheap(), "reuseList");
PagesList.Stripe[] bucket = GridTestUtils.getFieldValue(reuseList, "bucket");
long[] ids = null;
if (bucket != null) {
ids = new long[bucket.length];
for (int i = 0; i < bucket.length; i++) ids[i] = bucket[i].tailId;
}
return new T2<>(ids, 0);
}
use of org.apache.ignite.internal.processors.cache.persistence.tree.reuse.ReuseListImpl in project ignite by apache.
the class GridCacheOffheapManager method initDataStructures.
/**
* {@inheritDoc}
*/
@Override
protected void initDataStructures() throws IgniteCheckedException {
Metas metas = getOrAllocateCacheMetas();
RootPage reuseListRoot = metas.reuseListRoot;
reuseList = new ReuseListImpl(grp.groupId(), grp.cacheOrGroupName(), grp.dataRegion().pageMemory(), ctx.wal(), reuseListRoot.pageId().pageId(), reuseListRoot.isAllocated());
RootPage metastoreRoot = metas.treeRoot;
indexStorage = new IndexStorageImpl(grp.dataRegion().pageMemory(), ctx.wal(), globalRemoveId(), grp.groupId(), PageIdAllocator.INDEX_PARTITION, PageIdAllocator.FLAG_IDX, reuseList, metastoreRoot.pageId().pageId(), metastoreRoot.isAllocated());
((GridCacheDatabaseSharedManager) ctx.database()).addCheckpointListener(this);
}
Aggregations