/** * @return Group name if it is specified, otherwise cache name. */ public String cacheOrGroupName() { return grpName != null ? grpName : cacheCfg.getName(); }
/** * @return Cache name. */ public String name() { return config.getName(); }
/** * @return Cache name. */ public String cacheName() { assert cacheCfg != null : this; return cacheCfg.getName(); }
/** * @return Cache name. */ public String cacheName() { return ccfg.getName(); }
/** * @return {@code True} if this is cache group for one of system caches. */ public boolean systemCache() { return !sharedGroup() && CU.isSystemCache(ccfg.getName()); }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(DynamicCacheDescriptor.class, this, "cacheName", U.maskName(cacheCfg.getName())); } }
/** {@inheritDoc} */ @Override public void initializeForCache(CacheGroupDescriptor grpDesc, StoredCacheData cacheData) throws IgniteCheckedException { assert storeWorkDir != null; int grpId = grpDesc.groupId(); if (!idxCacheStores.containsKey(grpId)) { CacheStoreHolder holder = initForCache(grpDesc, cacheData.config()); CacheStoreHolder old = idxCacheStores.put(grpId, holder); assert old == null : "Non-null old store holder for cache: " + cacheData.config().getName(); } }
@Override public Void call() throws Exception { grid(gridIdx).destroyCache(cacheConfiguration(gridIdx, cacheIdx).getName()); return null; } });
@Override public Object call() throws Exception { grid(0).cache(ccfg.getName()); return null; } }, IllegalStateException.class, "Failed to get cache because it is a system cache");
/** * Constructor of not started cache context. * * @param cacheDesc Cache descriptor. */ public GridCacheContextInfo(DynamicCacheDescriptor cacheDesc) { config = cacheDesc.cacheConfiguration(); dynamicDeploymentId = cacheDesc.deploymentId(); groupId = cacheDesc.groupId(); cacheId = CU.cacheId(config.getName()); clientCache = true; }
/** * @param c Cache proxy. */ protected void printPartitionState(IgniteCache<?, ?> c) { printPartitionState(c.getConfiguration(CacheConfiguration.class).getName(), 0); }
/** {@inheritDoc} */ @Override protected void start0() throws IgniteCheckedException { metaCacheStartLatch = new CountDownLatch(1); cfg = igfsCtx.configuration(); evts = igfsCtx.kernalContext().event(); sampling = new IgfsSamplingKey(cfg.getName()); log = igfsCtx.kernalContext().log(IgfsMetaManager.class); metaCacheName = cfg.getMetaCacheConfiguration().getName(); }
/** {@inheritDoc} */ @Override public void validateCacheConfiguration(CacheConfiguration cfg) throws IgniteCheckedException { EvictionPolicy evictPlc = cfg.getEvictionPolicyFactory() != null ? (EvictionPolicy)cfg.getEvictionPolicyFactory().create() : cfg.getEvictionPolicy(); if (evictPlc != null && evictPlc instanceof IgfsPerBlockLruEvictionPolicy) { EvictionFilter evictFilter = cfg.getEvictionFilter(); if (evictFilter != null && !(evictFilter instanceof IgfsEvictionFilter)) throw new IgniteCheckedException("Eviction filter cannot be set explicitly when using " + "IgfsPerBlockLruEvictionPolicy: " + U.maskName(cfg.getName())); } }
@Override public Object call() throws Exception { CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); ccfg.setName(DYNAMIC_CACHE_NAME); futs.add(kernal.context().cache().dynamicStartCache(ccfg, ccfg.getName(), null, true, true, true)); return null; } }, threadNum, "cache-starter");
@Override public boolean apply() { int metaSize = 0; for (Object metaId : grid(0).cachex(igfs.configuration().getMetaCacheConfiguration().getName()) .keySet()) { if (!IgfsUtils.isRootOrTrashId((IgniteUuid)metaId)) metaSize++; } return metaSize == 0; } }, 5000);
/** * @param ignite Node. * @param ccfg Cache configuration. * @return Created cache. */ private <K, V> IgniteCache<K, V> createCache(Ignite ignite, CacheConfiguration<K, V> ccfg) { IgniteCache<K, V> cache = ignite.createCache(ccfg); if (!MvccFeatureChecker.forcedMvcc() || MvccFeatureChecker.isSupported(Feature.NEAR_CACHE)) ignite(NODES - 1).createNearCache(ccfg.getName(), new NearCacheConfiguration<>()); return cache; }
/** * @param ignite Ignite. * @param name Cache name. * @param expBackups Expected number of backups. */ private void checkCreate(final Ignite ignite, final String name, int expBackups) { IgniteCache cache = ignite.createCache(name); assertNotNull(cache); CacheConfiguration cfg = (CacheConfiguration)cache.getConfiguration(CacheConfiguration.class); assertEquals(name, cfg.getName()); assertEquals(expBackups, cfg.getBackups()); }
/** * @param c Closure. */ private void executeTestForAllCaches(CI2<Ignite, IgniteCache<Integer, Integer>> c) { for (int i = 0; i < gridCount(); i++) { Ignite ignite = ignite(i); ClusterNode locNode = ignite.cluster().localNode(); log.info("Run test for node [node=" + locNode.id() + ", client=" + locNode.isClient() + ']'); for (CacheConfiguration ccfg : cacheConfigurations()) c.apply(ignite, ignite.cache(ccfg.getName())); } }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); Ignite client = ignite(gridCount() - 1); assertTrue(client.cluster().localNode().isClient()); for (CacheConfiguration<Integer, Integer> ccfg : cacheConfigurations()) { grid(0).createCache(ccfg); client.createNearCache(ccfg.getName(), new NearCacheConfiguration<>()); } awaitPartitionMapExchange(); }