use of org.apache.ignite.internal.processors.cache.persistence.tree.reuse.ReuseList in project ignite by apache.
the class IgniteCacheOffheapManagerImpl method allocateForTree.
/**
* @return Page ID.
* @throws IgniteCheckedException If failed.
*/
private long allocateForTree() throws IgniteCheckedException {
ReuseList reuseList = grp.reuseList();
long pageId;
if (reuseList == null || (pageId = reuseList.takeRecycledPage()) == 0L)
pageId = grp.dataRegion().pageMemory().allocatePage(grp.groupId(), INDEX_PARTITION, FLAG_IDX);
return pageId;
}
use of org.apache.ignite.internal.processors.cache.persistence.tree.reuse.ReuseList in project ignite by apache.
the class GridCacheProcessor method startCacheGroup.
/**
* @param desc Group descriptor.
* @param cacheType Cache type.
* @param affNode Affinity node flag.
* @param cacheObjCtx Cache object context.
* @param exchTopVer Current topology version.
* @return Started cache group.
* @throws IgniteCheckedException If failed.
*/
private CacheGroupContext startCacheGroup(CacheGroupDescriptor desc, CacheType cacheType, boolean affNode, CacheObjectContext cacheObjCtx, AffinityTopologyVersion exchTopVer) throws IgniteCheckedException {
CacheConfiguration cfg = new CacheConfiguration(desc.config());
String memPlcName = cfg.getDataRegionName();
DataRegion memPlc = sharedCtx.database().dataRegion(memPlcName);
FreeList freeList = sharedCtx.database().freeList(memPlcName);
ReuseList reuseList = sharedCtx.database().reuseList(memPlcName);
CacheGroupContext grp = new CacheGroupContext(sharedCtx, desc.groupId(), desc.receivedFrom(), cacheType, cfg, affNode, memPlc, cacheObjCtx, freeList, reuseList, exchTopVer, desc.walEnabled());
for (Object obj : grp.configuredUserObjects()) prepare(cfg, obj, false);
U.startLifecycleAware(grp.configuredUserObjects());
grp.start();
CacheGroupContext old = cacheGrps.put(desc.groupId(), grp);
if (!grp.systemCache() && !U.IGNITE_MBEANS_DISABLED) {
try {
U.registerMBean(ctx.config().getMBeanServer(), ctx.igniteInstanceName(), CACHE_GRP_METRICS_MBEAN_GRP, grp.cacheOrGroupName(), grp.mxBean(), CacheGroupMetricsMXBean.class);
} catch (Throwable e) {
U.error(log, "Failed to register MBean for cache group: " + grp.name(), e);
}
}
assert old == null : old.name();
return grp;
}
Aggregations