/** {@inheritDoc} */ @Override public CacheConfiguration configuration() { return delegate.configuration(); }
/** {@inheritDoc} */ @Override public CacheConfiguration configuration() { return delegate.get().configuration(); }
/** */ private static IgniteCache<?, ?> table(IgniteEx ignite) { assert ignite.cachex("person").configuration().getAtomicityMode() == CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT; assert ignite.cachex("person").configuration().getCacheMode() == CacheMode.REPLICATED; return ignite.cache("person"); }
/** * Must be called when the grid is up. */ private List<Path> getIndexBinPaths() { return G.allGrids().stream() .map(grid -> (IgniteEx) grid) .map(grid -> { IgniteInternalCache<Object, Object> cachex = grid.cachex(DEFAULT_CACHE_NAME); assertNotNull(cachex); FilePageStoreManager pageStoreMgr = (FilePageStoreManager) cachex.context().shared().pageStore(); assertNotNull(pageStoreMgr); File cacheWorkDir = pageStoreMgr.cacheWorkDir(cachex.configuration()); return cacheWorkDir.toPath().resolve("index.bin"); }) .collect(Collectors.toList()); }
new T2<>((CacheConfiguration)null, cache.configuration().getNearConfiguration()));
pageStoreMgr.cacheWorkDir(node.cachex(cacheName).configuration());
/** */ @Test public void testDynamicTableCreateNotNullFieldsAllowed() throws Exception { executeSql("CREATE TABLE test(id INT PRIMARY KEY, field INT NOT NULL)"); String cacheName = QueryUtils.createTableCacheName("PUBLIC", "TEST"); IgniteEx client = grid(NODE_CLIENT); CacheConfiguration ccfg = client.context().cache().cache(cacheName).configuration(); QueryEntity qe = (QueryEntity)F.first(ccfg.getQueryEntities()); assertEquals(Collections.singleton("FIELD"), qe.getNotNullFields()); checkState("PUBLIC", "TEST", "FIELD"); }
/** {@inheritDoc} */ @Test public void testIndexRebuild() throws Exception { IgniteEx srv = startServer(); execute(srv, "CREATE TABLE T(k int primary key, v int) WITH \"cache_name=T,wrap_value=false," + "atomicity=transactional_snapshot\""); execute(srv, "CREATE INDEX IDX ON T(v)"); IgniteInternalCache cc = srv.cachex(CACHE_NAME); assertNotNull(cc); lockVersion(srv); putData(srv, false); checkDataState(srv, false); File cacheWorkDir = ((FilePageStoreManager)cc.context().shared().pageStore()).cacheWorkDir(cc.configuration()); File idxPath = cacheWorkDir.toPath().resolve("index.bin").toFile(); stopAllGrids(); assertTrue(U.delete(idxPath)); srv = startServer(); putData(srv, true); checkDataState(srv, true); }
File cacheWorkDir = ((FilePageStoreManager)cc.context().shared().pageStore()).cacheWorkDir(cc.configuration());
if (internalCache.configuration().getNearConfiguration() == null) { ctx.cache().dynamicStartCache(null, cacheName,
/** * @throws Exception If failed. */ @Test public void testPreConfiguredCache() throws Exception { FileSystemConfiguration igfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1); igfsCfg1.setName("igfs"); g1Cfg.setFileSystemConfiguration(igfsCfg1); CacheConfiguration ccfgData = dataCache(1024); ccfgData.setRebalanceTimeout(10001); CacheConfiguration ccfgMeta = metaCache(); ccfgMeta.setRebalanceTimeout(10002); igfsCfg1.setDataCacheConfiguration(ccfgData); igfsCfg1.setMetaCacheConfiguration(ccfgMeta); IgniteEx g = (IgniteEx)G.start(g1Cfg); assertEquals(10001, g.cachex(g.igfsx("igfs").configuration().getDataCacheConfiguration().getName()) .configuration().getRebalanceTimeout()); assertEquals(10002, g.cachex(g.igfsx("igfs").configuration().getMetaCacheConfiguration().getName()) .configuration().getRebalanceTimeout()); }
CacheConfiguration ccfg = cache.configuration();
if (cache.configuration().getNearConfiguration() == null) { ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(),
/** */ void checkEncryptedCaches(IgniteEx grid0, IgniteEx grid1) { Set<String> cacheNames = new HashSet<>(grid0.cacheNames()); cacheNames.addAll(grid1.cacheNames()); for (String cacheName : cacheNames) { CacheConfiguration ccfg = grid1.cache(cacheName).getConfiguration(CacheConfiguration.class); if (!ccfg.isEncryptionEnabled()) continue; IgniteInternalCache<?, ?> encrypted0 = grid0.cachex(cacheName); int grpId = CU.cacheGroupId(cacheName, ccfg.getGroupName()); assertNotNull(encrypted0); IgniteInternalCache<?, ?> encrypted1 = grid1.cachex(cacheName); assertNotNull(encrypted1); assertTrue(encrypted1.configuration().isEncryptionEnabled()); KeystoreEncryptionKey encKey0 = (KeystoreEncryptionKey)grid0.context().encryption().groupKey(grpId); assertNotNull(encKey0); assertNotNull(encKey0.key()); if (!grid1.configuration().isClientMode()) { KeystoreEncryptionKey encKey1 = (KeystoreEncryptionKey)grid1.context().encryption().groupKey(grpId); assertNotNull(encKey1); assertNotNull(encKey1.key()); assertEquals(encKey0.key(), encKey1.key()); } else assertNull(grid1.context().encryption().groupKey(grpId)); } checkData(grid0); }
/** {@inheritDoc} */ @Override public CacheConfiguration configuration() { return delegate.configuration(); }
new T2<>((CacheConfiguration)null, cache.configuration().getNearConfiguration()));
if (internalCache.configuration().getNearConfiguration() == null) { ctx.cache().dynamicStartCache(null, cacheName,
if (cache.configuration().getNearConfiguration() == null) { ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(),