Search in sources :

Example 1 with ReuseList

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;
}
Also used : ReuseList(org.apache.ignite.internal.processors.cache.persistence.tree.reuse.ReuseList)

Example 2 with ReuseList

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;
}
Also used : GridTimeoutObject(org.apache.ignite.internal.processors.timeout.GridTimeoutObject) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) NearCacheConfiguration(org.apache.ignite.configuration.NearCacheConfiguration) ReuseList(org.apache.ignite.internal.processors.cache.persistence.tree.reuse.ReuseList) DataRegion(org.apache.ignite.internal.processors.cache.persistence.DataRegion) FreeList(org.apache.ignite.internal.processors.cache.persistence.freelist.FreeList)

Aggregations

ReuseList (org.apache.ignite.internal.processors.cache.persistence.tree.reuse.ReuseList)2 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)1 DataRegion (org.apache.ignite.internal.processors.cache.persistence.DataRegion)1 FreeList (org.apache.ignite.internal.processors.cache.persistence.freelist.FreeList)1 GridTimeoutObject (org.apache.ignite.internal.processors.timeout.GridTimeoutObject)1