Search in sources :

Example 1 with IgnitePageStoreManager

use of org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager in project ignite by apache.

the class GridCacheProcessor method createSharedContext.

/**
     * Creates shared context.
     *
     * @param kernalCtx Kernal context.
     * @param storeSesLsnrs Store session listeners.
     * @return Shared context.
     * @throws IgniteCheckedException If failed.
     */
@SuppressWarnings("unchecked")
private GridCacheSharedContext createSharedContext(GridKernalContext kernalCtx, Collection<CacheStoreSessionListener> storeSesLsnrs) throws IgniteCheckedException {
    IgniteTxManager tm = new IgniteTxManager();
    GridCacheMvccManager mvccMgr = new GridCacheMvccManager();
    GridCacheVersionManager verMgr = new GridCacheVersionManager();
    GridCacheDeploymentManager depMgr = new GridCacheDeploymentManager();
    GridCachePartitionExchangeManager exchMgr = new GridCachePartitionExchangeManager();
    IgniteCacheDatabaseSharedManager dbMgr = ctx.plugins().createComponent(IgniteCacheDatabaseSharedManager.class);
    if (dbMgr == null)
        dbMgr = new IgniteCacheDatabaseSharedManager();
    IgnitePageStoreManager pageStoreMgr = ctx.plugins().createComponent(IgnitePageStoreManager.class);
    IgniteWriteAheadLogManager walMgr = ctx.plugins().createComponent(IgniteWriteAheadLogManager.class);
    GridCacheIoManager ioMgr = new GridCacheIoManager();
    CacheAffinitySharedManager topMgr = new CacheAffinitySharedManager();
    GridCacheSharedTtlCleanupManager ttl = new GridCacheSharedTtlCleanupManager();
    CacheJtaManagerAdapter jta = JTA.createOptional();
    return new GridCacheSharedContext(kernalCtx, tm, verMgr, mvccMgr, pageStoreMgr, walMgr, dbMgr, depMgr, exchMgr, topMgr, ioMgr, ttl, jta, storeSesLsnrs);
}
Also used : CacheJtaManagerAdapter(org.apache.ignite.internal.processors.cache.jta.CacheJtaManagerAdapter) IgnitePageStoreManager(org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager) IgniteWriteAheadLogManager(org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager) IgniteTxManager(org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager) GridCacheVersionManager(org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.database.IgniteCacheDatabaseSharedManager)

Example 2 with IgnitePageStoreManager

use of org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager in project ignite by apache.

the class GridClusterStateProcessor method onActivate.

/**
     *
     */
private Exception onActivate(ChangeGlobalStateContext cgsCtx) {
    final boolean client = ctx.clientNode();
    if (log.isInfoEnabled())
        log.info("Start activation process [nodeId=" + this.ctx.localNodeId() + ", client=" + client + ", topVer=" + cgsCtx.topVer + "]");
    Collection<CacheConfiguration> cfgs = new ArrayList<>();
    for (DynamicCacheChangeRequest req : cgsCtx.batch.requests()) {
        if (req.startCacheConfiguration() != null)
            cfgs.add(req.startCacheConfiguration());
    }
    try {
        if (!client) {
            sharedCtx.database().lock();
            IgnitePageStoreManager pageStore = sharedCtx.pageStore();
            if (pageStore != null)
                pageStore.onActivate(ctx);
            if (sharedCtx.wal() != null)
                sharedCtx.wal().onActivate(ctx);
            sharedCtx.database().initDataBase();
            for (CacheConfiguration cfg : cfgs) {
                if (CU.isSystemCache(cfg.getName()))
                    if (pageStore != null)
                        pageStore.initializeForCache(cfg);
            }
            for (CacheConfiguration cfg : cfgs) {
                if (!CU.isSystemCache(cfg.getName()))
                    if (pageStore != null)
                        pageStore.initializeForCache(cfg);
            }
            sharedCtx.database().onActivate(ctx);
        }
        if (log.isInfoEnabled())
            log.info("Success activate wal, dataBase, pageStore [nodeId=" + ctx.localNodeId() + ", client=" + client + ", topVer=" + cgsCtx.topVer + "]");
        return null;
    } catch (Exception e) {
        log.error("Fail activate wal, dataBase, pageStore [nodeId=" + ctx.localNodeId() + ", client=" + client + ", topVer=" + cgsCtx.topVer + "]", e);
        if (!ctx.clientNode())
            sharedCtx.database().unLock();
        return e;
    }
}
Also used : DynamicCacheChangeRequest(org.apache.ignite.internal.processors.cache.DynamicCacheChangeRequest) IgnitePageStoreManager(org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager) ArrayList(java.util.ArrayList) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) IgniteInterruptedCheckedException(org.apache.ignite.internal.IgniteInterruptedCheckedException)

Aggregations

IgnitePageStoreManager (org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager)2 ArrayList (java.util.ArrayList)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteException (org.apache.ignite.IgniteException)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 IgniteInterruptedCheckedException (org.apache.ignite.internal.IgniteInterruptedCheckedException)1 IgniteWriteAheadLogManager (org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager)1 DynamicCacheChangeRequest (org.apache.ignite.internal.processors.cache.DynamicCacheChangeRequest)1 IgniteCacheDatabaseSharedManager (org.apache.ignite.internal.processors.cache.database.IgniteCacheDatabaseSharedManager)1 CacheJtaManagerAdapter (org.apache.ignite.internal.processors.cache.jta.CacheJtaManagerAdapter)1 IgniteTxManager (org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager)1 GridCacheVersionManager (org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager)1