use of org.apache.ignite.internal.processors.cache.CacheJoinNodeDiscoveryData.CacheInfo 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();
}
use of org.apache.ignite.internal.processors.cache.CacheJoinNodeDiscoveryData.CacheInfo in project ignite by apache.
the class GridCacheProcessor method addCacheOnJoin.
/**
* @param cfg Cache configuration.
* @param sql SQL flag.
* @param caches Caches map.
* @param templates Templates map.
* @throws IgniteCheckedException If failed.
*/
private void addCacheOnJoin(CacheConfiguration<?, ?> cfg, boolean sql, Map<String, CacheInfo> caches, Map<String, CacheInfo> templates) throws IgniteCheckedException {
String cacheName = cfg.getName();
CU.validateCacheName(cacheName);
cloneCheckSerializable(cfg);
CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(cfg);
// Initialize defaults.
initialize(cfg, cacheObjCtx);
StoredCacheData cacheData = new StoredCacheData(cfg);
cacheData.sql(sql);
boolean template = cacheName.endsWith("*");
if (!template) {
if (caches.containsKey(cacheName)) {
throw new IgniteCheckedException("Duplicate cache name found (check configuration and " + "assign unique name to each cache): " + cacheName);
}
CacheType cacheType = cacheType(cacheName);
if (cacheType != CacheType.USER && cfg.getDataRegionName() == null)
cfg.setDataRegionName(sharedCtx.database().systemDateRegionName());
if (!cacheType.userCache())
stopSeq.addLast(cacheName);
else
stopSeq.addFirst(cacheName);
caches.put(cacheName, new CacheJoinNodeDiscoveryData.CacheInfo(cacheData, cacheType, cacheData.sql(), 0));
} else
templates.put(cacheName, new CacheJoinNodeDiscoveryData.CacheInfo(cacheData, CacheType.USER, false, 0));
}
Aggregations