Search in sources :

Example 1 with IgniteTransactionsImpl

use of org.apache.ignite.internal.processors.cache.transactions.IgniteTransactionsImpl in project ignite by apache.

the class GridCacheProcessor method start.

/** {@inheritDoc} */
@SuppressWarnings({ "unchecked" })
@Override
public void start(boolean activeOnStart) throws IgniteCheckedException {
    cachesInfo = new ClusterCachesInfo(ctx);
    DeploymentMode depMode = ctx.config().getDeploymentMode();
    if (!F.isEmpty(ctx.config().getCacheConfiguration())) {
        if (depMode != CONTINUOUS && depMode != SHARED)
            U.warn(log, "Deployment mode for cache is not CONTINUOUS or SHARED " + "(it is recommended that you change deployment mode and restart): " + depMode, "Deployment mode for cache is not CONTINUOUS or SHARED.");
    }
    initializeInternalCacheNames();
    sharedCtx = createSharedContext(ctx, CU.startStoreSessionListeners(ctx, ctx.config().getCacheStoreSessionListenerFactories()));
    transactions = new IgniteTransactionsImpl(sharedCtx);
    // Start shared managers.
    for (GridCacheSharedManager mgr : sharedCtx.managers()) mgr.start(sharedCtx);
    if (activeOnStart && !ctx.config().isDaemon()) {
        Map<String, CacheJoinNodeDiscoveryData.CacheInfo> caches = new HashMap<>();
        Map<String, CacheJoinNodeDiscoveryData.CacheInfo> templates = new HashMap<>();
        addCacheOnJoinFromConfig(caches, templates);
        addCacheOnJoinFromPersistentStore(caches, templates);
        CacheJoinNodeDiscoveryData discoData = new CacheJoinNodeDiscoveryData(IgniteUuid.randomUuid(), caches, templates, startAllCachesOnClientStart());
        cachesInfo.onStart(discoData);
    } else {
        cachesInfo.onStart(new CacheJoinNodeDiscoveryData(IgniteUuid.randomUuid(), Collections.<String, CacheJoinNodeDiscoveryData.CacheInfo>emptyMap(), Collections.<String, CacheJoinNodeDiscoveryData.CacheInfo>emptyMap(), false));
    }
    if (log.isDebugEnabled())
        log.debug("Started cache processor.");
}
Also used : IgniteTransactionsImpl(org.apache.ignite.internal.processors.cache.transactions.IgniteTransactionsImpl) IdentityHashMap(java.util.IdentityHashMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) DeploymentMode(org.apache.ignite.configuration.DeploymentMode)

Example 2 with IgniteTransactionsImpl

use of org.apache.ignite.internal.processors.cache.transactions.IgniteTransactionsImpl in project ignite by apache.

the class GridCacheProcessor method start.

/**
 * {@inheritDoc}
 */
@SuppressWarnings({ "unchecked" })
@Override
public void start() throws IgniteCheckedException {
    cachesInfo = new ClusterCachesInfo(ctx);
    DeploymentMode depMode = ctx.config().getDeploymentMode();
    if (!F.isEmpty(ctx.config().getCacheConfiguration())) {
        if (depMode != CONTINUOUS && depMode != SHARED)
            U.warn(log, "Deployment mode for cache is not CONTINUOUS or SHARED " + "(it is recommended that you change deployment mode and restart): " + depMode, "Deployment mode for cache is not CONTINUOUS or SHARED.");
    }
    initializeInternalCacheNames();
    Collection<CacheStoreSessionListener> sessionListeners = CU.startStoreSessionListeners(ctx, ctx.config().getCacheStoreSessionListenerFactories());
    sharedCtx = createSharedContext(ctx, sessionListeners);
    transactions = new IgniteTransactionsImpl(sharedCtx);
    // Start shared managers.
    for (GridCacheSharedManager mgr : sharedCtx.managers()) mgr.start(sharedCtx);
    if (!ctx.isDaemon()) {
        Map<String, CacheInfo> caches = new HashMap<>();
        Map<String, CacheInfo> templates = new HashMap<>();
        addCacheOnJoinFromConfig(caches, templates);
        CacheJoinNodeDiscoveryData discoData = new CacheJoinNodeDiscoveryData(IgniteUuid.randomUuid(), caches, templates, startAllCachesOnClientStart());
        cachesInfo.onStart(discoData);
        if (log.isDebugEnabled())
            log.debug("Started cache processor.");
    }
    ctx.state().cacheProcessorStarted();
    ctx.authentication().cacheProcessorStarted();
}
Also used : IgniteTransactionsImpl(org.apache.ignite.internal.processors.cache.transactions.IgniteTransactionsImpl) IdentityHashMap(java.util.IdentityHashMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) DeploymentMode(org.apache.ignite.configuration.DeploymentMode) CacheStoreSessionListener(org.apache.ignite.cache.store.CacheStoreSessionListener) CacheInfo(org.apache.ignite.internal.processors.cache.CacheJoinNodeDiscoveryData.CacheInfo)

Aggregations

HashMap (java.util.HashMap)2 IdentityHashMap (java.util.IdentityHashMap)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 DeploymentMode (org.apache.ignite.configuration.DeploymentMode)2 IgniteTransactionsImpl (org.apache.ignite.internal.processors.cache.transactions.IgniteTransactionsImpl)2 CacheStoreSessionListener (org.apache.ignite.cache.store.CacheStoreSessionListener)1 CacheInfo (org.apache.ignite.internal.processors.cache.CacheJoinNodeDiscoveryData.CacheInfo)1