/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); startGrids(NODE_COUNT); startGrid(NODE_CLIENT); // Add cache template with read-through cache store. grid(NODE_CLIENT).addCacheConfiguration( buildCacheConfigurationRestricted(CACHE_READ_THROUGH, true, false, false)); // Add cache template with cache interceptor. grid(NODE_CLIENT).addCacheConfiguration( buildCacheConfigurationRestricted(CACHE_INTERCEPTOR, false, true, false)); awaitPartitionMapExchange(); }
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); for (IgniteConfiguration cfg : configurations()) Ignition.start(cfg); client().addCacheConfiguration(cacheConfiguration()); client().addCacheConfiguration(cacheConfiguration().setName(CACHE_NAME + "_async") .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_ASYNC)); client().addCacheConfiguration(cacheConfiguration().setName(CACHE_NAME_BACKUPS).setBackups(DFLT_BACKUPS)); }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); IgniteEx grid = startGrid(getConfiguration(getTestIgniteInstanceName(0)) .setCacheConfiguration(new CacheConfiguration("test") .setQueryEntities(Collections.singletonList(new QueryEntity(Integer.class, Integer.class))))); // add cache template for cache with enabled read-through cache store grid.addCacheConfiguration(new CacheConfiguration<>(CACHE_STORE_TEMPLATE) .setCacheStoreFactory(singletonFactory(new TestCacheStore())).setReadThrough(true)); // add cache template for cache with enabled cache interceptor grid.addCacheConfiguration(new CacheConfiguration<>(CACHE_INTERCEPTOR_TEMPLATE) .setInterceptor(new TestCacheInterceptor())); }
CacheConfiguration cfg = PlatformConfigurationUtils.readCacheConfiguration(reader, CURRENT_VER); ctx.grid().addCacheConfiguration(cfg);
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected void beforeTest() throws Exception { super.beforeTest(); disableScheduledVacuum = getName().equals("testSelectForUpdateAfterAbortedTx"); IgniteEx grid = startGrid(0); CacheConfiguration seg = new CacheConfiguration("segmented*"); seg.setCacheMode(cacheMode()); if (seg.getCacheMode() == PARTITIONED) seg.setQueryParallelism(4); grid.addCacheConfiguration(seg); try (Connection c = connect(grid)) { execute(c, "create table person (id int primary key, firstName varchar, lastName varchar) " + "with \"atomicity=transactional_snapshot,cache_name=Person\""); execute(c, "create table person_seg (id int primary key, firstName varchar, lastName varchar) " + "with \"atomicity=transactional_snapshot,cache_name=PersonSeg,template=segmented\""); try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) { for (int i = 1; i <= CACHE_SIZE; i++) { execute(c, "insert into person(id, firstName, lastName) values(" + i + ",'" + i + "','" + i + "')"); execute(c, "insert into person_seg(id, firstName, lastName) " + "values(" + i + ",'" + i + "','" + i + "')"); } tx.commit(); } } startGridsMultiThreaded(1, 2); }
CacheConfiguration cfg = PlatformConfigurationUtils.readCacheConfiguration(reader, CURRENT_VER); ctx.grid().addCacheConfiguration(cfg);