use of org.apache.ignite.internal.processors.cache.persistence.partstate.PagesAllocationRange in project ignite by apache.
the class GridCacheOffheapManager method addPartition.
/**
* @param part Local partition.
* @param map Map to add values to.
* @param metaPageAddr Meta page address
* @param io Page Meta IO
* @param grpId Cache Group ID.
* @param currAllocatedPageCnt total number of pages allocated for partition <code>[partition, grpId]</code>
*/
private static boolean addPartition(GridDhtLocalPartition part, PartitionAllocationMap map, long metaPageAddr, PageMetaIO io, int grpId, int partId, int currAllocatedPageCnt, long partSize) {
if (part != null) {
boolean reserved = part.reserve();
if (!reserved)
return false;
} else
assert partId == PageIdAllocator.INDEX_PARTITION : partId;
assert PageIO.getPageId(metaPageAddr) != 0;
int lastAllocatedPageCnt = io.getLastAllocatedPageCount(metaPageAddr);
int curPageCnt = partSize == 0 ? 0 : currAllocatedPageCnt;
map.put(new GroupPartitionId(grpId, partId), new PagesAllocationRange(lastAllocatedPageCnt, curPageCnt));
return true;
}
Aggregations