@Override public Void call() throws Exception { grid(0).createCache(ccfg); return null; } }, IgniteCheckedException.class, "Index type is not set");
@Override public Object call() throws Exception { return grid(NODE_CLIENT).createCache( buildCacheConfigurationRestricted("dynBadCfgCacheRT", true, false, true)); } }, IgniteCheckedException.class, READ_THROUGH_ERR_MSG);
@Override public Void call() throws Exception { grid(0).createCache(ccfg); return null; } }, IgniteCheckedException.class, "Value type cannot be null or empty");
@Override public Void call() throws Exception { grid(0).createCache(ccfg); return null; } }, IgniteCheckedException.class, "Duplicate index name");
@Override public Object call() throws Exception { return grid(NODE_CLIENT).createCache( buildCacheConfigurationRestricted("dynBadCfgCacheINT", false, true, true)); } }, IgniteCheckedException.class, INTERCEPTOR_ERR_MSG);
/** {@inheritDoc} */ @Override public void beforeTestsStarted() throws Exception { startGrids(1); cache = grid(0).createCache(DEFAULT_CACHE_NAME); }
/** {@inheritDoc} */ @Override public ClientResponse process(ClientConnectionContext ctx) { try { ctx.kernalContext().grid().createCache(cacheCfg); } catch (CacheExistsException e) { throw new IgniteClientException(ClientStatus.CACHE_EXISTS, e.getMessage()); } return super.process(ctx); } }
/** {@inheritDoc} */ @Override public ClientResponse process(ClientConnectionContext ctx) { try { ctx.kernalContext().grid().createCache(cacheName); } catch (CacheExistsException e) { throw new IgniteClientException(ClientStatus.CACHE_EXISTS, e.getMessage()); } return super.process(ctx); } }
/** * @throws Exception If failed. */ @Params(atomicityMode = TRANSACTIONAL, cacheMode = REPLICATED) @Test public void testCreateCacheTransactionalReplicated() throws Exception { doTest( asMessagePredicate(CacheBlockOnReadAbstractTest::createCachePredicate), () -> baseline.get(0).createCache(UUID.randomUUID().toString()) ); }
/** * @throws Exception If failed. */ @Test public void testConfiguredFromAnnotations() throws Exception { IgniteEx grid = grid(0); CacheConfiguration<Integer, Salary> ccfg = new CacheConfiguration<>("SalaryCache-3"); ccfg.setIndexedTypes(Integer.class, SalaryWithAnnotations.class); grid.createCache(ccfg); checkPrecisionAndScale(SalaryWithAnnotations.class.getSimpleName().toUpperCase(), "amount", PRECISION, SCALE); }
/** * @throws Exception If failed. */ @Test public void testConfiguredFromQueryEntityInDynamicallyCreatedCache() throws Exception { IgniteEx grid = grid(0); String tabName = SALARY_TAB_NAME + "2"; CacheConfiguration<Integer, Salary> ccfg = cacheCfg(tabName, "SalaryCache-2"); IgniteCache<Integer, Salary> cache = grid.createCache(ccfg); checkPrecisionAndScale(tabName, "amount", PRECISION, SCALE); }
/** * Create cache at server node and put some values into the cache. */ private void createAndFillServerCache() { srvNode.createCache(cacheConfiguration()); for (int i = 0; i < CACHE_ELEMENT_COUNT; i++) srvNode.cache(PERSON_CACHE).put(i, new Person(i, "name-" + i)); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { grid(0).createCache(cacheConfiguration(cacheMode(), FULL_SYNC, 1, 32). setIndexedTypes(Integer.class, MvccTestAccount.class)); }
/** * Test duplicate key class. * * @throws Exception If failed. */ @Test public void testDuplicateKeyClass() throws Exception { CacheConfiguration ccfg = new CacheConfiguration() .setName(CACHE_NAME) .setIndexedTypes(UUID.class, Clazz1.class, UUID.class, Clazz2.class); grid(0).createCache(ccfg); }
/** @throws Exception If failed. */ @Test public void testCreateEncryptedNotPersistedCacheFail() throws Exception { GridTestUtils.assertThrowsWithCause(() -> { CacheConfiguration<Long, String> ccfg = new CacheConfiguration<>(NO_PERSISTENCE_REGION); ccfg.setEncryptionEnabled(true); ccfg.setDataRegionName(NO_PERSISTENCE_REGION); grid(0).createCache(ccfg); }, IgniteCheckedException.class); }
/** * @param cacheName Cache name. * @throws Exception If failed. */ private void createCacheWithAffinity(String cacheName) throws Exception { CacheConfiguration ccfg = cacheConfiguration(grid(0).name()); ccfg.setName(cacheName); ccfg.setAffinity(new DummyAffinity()); grid(0).createCache(ccfg); }
/** * @throws Exception If failed. */ @Test public void testStore() throws Exception { int inputSize = 100; store = new TestStore(inputSize); IgniteCache<?, ?> cache = grid(0).createCache(cacheConfiguration()); cache.localLoadCache(null, 1, 2, 3); assertEquals(inputSize - (inputSize / 10), cache.localSize()); }
/** @throws Exception If failed. */ @Test public void testCreateNotEncryptedCacheInEncryptedGroupFails() throws Exception { createEncryptedCache(ENCRYPTED_CACHE + "3", ENCRYPTED_GROUP + "3"); IgniteEx grid = grid(0); GridTestUtils.assertThrowsWithCause(() -> { grid.createCache(new CacheConfiguration<>(ENCRYPTED_CACHE + "4") .setEncryptionEnabled(false) .setGroupName(ENCRYPTED_GROUP + "3")); }, IgniteCheckedException.class); }
/** * @param cacheName Cache name. * @param mode Atomicity mode. * @throws Exception If failed. */ protected void createCache(String cacheName, CacheAtomicityMode mode) throws Exception { CacheConfiguration ccfg = cacheConfiguration(grid(0).name()); ccfg.setName(cacheName); ccfg.setAtomicityMode(mode); ccfg.setAffinity(new RendezvousAffinityFunction(false, PARTS_CNT)); grid(0).createCache(ccfg); }
/** {@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(); }