/** * @return Cache configurations. */ private List<CacheConfiguration> cacheConfigurations() { List<CacheConfiguration> ccfgs = new ArrayList<>(); for (int i = 0; i < 10; i++) { CacheConfiguration ccfg = new CacheConfiguration("cache-" + i); ccfg.setAtomicityMode(i % 2 == 0 ? ATOMIC : TRANSACTIONAL); ccfgs.add(ccfg); } return ccfgs; }
/** {@inheritDoc} */ @Override public Void apply(CacheConfiguration cfg) { cfg.setNearConfiguration(null); cfg.setAtomicityMode(TRANSACTIONAL_SNAPSHOT); return null; } }
@Override public Void apply(CacheConfiguration cc) { cc.setAtomicityMode(ATOMIC); cc.setNearConfiguration(null); cc.setCacheStoreFactory(null); return null; } };
/** * @param name Cache name. * @param atomicityMode Atomicity mode. * @return Cache configuration. */ protected final CacheConfiguration cacheConfiguration(String name, CacheAtomicityMode atomicityMode) { CacheConfiguration ccfg = new CacheConfiguration(name); ccfg.setWriteSynchronizationMode(FULL_SYNC); ccfg.setAtomicityMode(atomicityMode); ccfg.setBackups(1); return ccfg; }
/** * @param cacheMode Cache mode. * @param atomicityMode Atomicity mode. * @return Cache configuration. */ private CacheConfiguration<Integer, Integer> cacheConfiguration(CacheMode cacheMode, CacheAtomicityMode atomicityMode) { CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME); ccfg.setCacheMode(cacheMode); ccfg.setAtomicityMode(atomicityMode); ccfg.setBackups(1); return ccfg; }
/** * @param cacheMode Cache mode. * @param atomicityMode Atomicity mode. * @return Cache configuration. */ private CacheConfiguration<Integer, TestValue> cacheConfiguration(CacheMode cacheMode, CacheAtomicityMode atomicityMode) { CacheConfiguration<Integer, TestValue> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME); ccfg.setCacheMode(cacheMode); ccfg.setAtomicityMode(atomicityMode); ccfg.setBackups(1); return ccfg; }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); ccfg.setAtomicityMode(TRANSACTIONAL); CacheConfiguration ccfg1 = new CacheConfiguration(REPLICATED_TEST_CACHE) .setCacheMode(REPLICATED) .setAtomicityMode(TRANSACTIONAL) .setReadFromBackup(false); cfg.setCacheConfiguration(ccfg, ccfg1); return cfg; }
/** * @throws Exception If failed. */ @Test public void testMvccTxLeavesObjectsInLocalPartition() throws Exception { checkTxLeavesObjectsInLocalPartition(cacheConfiguration().setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT), TransactionConcurrency.PESSIMISTIC, REPEATABLE_READ); }
/** {@inheritDoc} */ @Override protected CacheConfiguration cacheConfiguration0() { CacheConfiguration cfg = new CacheConfiguration(); cfg.setCacheMode(REPLICATED); cfg.setAtomicityMode(TRANSACTIONAL); cfg.setWriteSynchronizationMode(FULL_SYNC); return cfg; } }
/** * @param cacheName Cache name. * @return Cache configuration. */ private CacheConfiguration cacheConfiguration(String cacheName) { CacheConfiguration ccfg = new CacheConfiguration(cacheName); ccfg.setName(cacheName); ccfg.setAtomicityMode(TRANSACTIONAL); ccfg.setAffinity(new RendezvousAffinityFunction(false, 16)); return ccfg; } /**
/** * @param igniteInstanceName Ignite instance name. * @return Cache configuration. */ protected CacheConfiguration cacheConfiguration(String igniteInstanceName) { CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); ccfg.setBackups(backups); ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); ccfg.setCacheMode(CacheMode.PARTITIONED); ccfg.setNearConfiguration(new NearCacheConfiguration()); return ccfg; }
/** * @throws Exception If fail. */ @Test public void testPessimisticReadCommittedUpdateNear() throws Exception { cache = client.createCache(cacheConfiguration().setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL), new NearCacheConfiguration<String, String>()); checkNear(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.READ_COMMITTED); }
/** * @throws Exception If fail. */ @Test public void testOptimisticSerializableUpdateNear() throws Exception { cache = client.createCache(cacheConfiguration().setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL), new NearCacheConfiguration<String, String>()); checkNear(TransactionConcurrency.OPTIMISTIC, TransactionIsolation.SERIALIZABLE); }
/** * @return Cache configuration. */ private CacheConfiguration cacheConfiguration() { CacheConfiguration cache = new CacheConfiguration(DEFAULT_CACHE_NAME); cache.setCacheMode(PARTITIONED); cache.setAtomicityMode(atomicityMode()); cache.setWriteSynchronizationMode(FULL_SYNC); cache.setBackups(1); cache.setRebalanceMode(SYNC); return cache; }
private CacheConfiguration cacheConfiguration(String cacheName) { CacheConfiguration ccfg = defaultCacheConfiguration(); ccfg.setName(cacheName); ccfg.setWriteSynchronizationMode(FULL_SYNC); ccfg.setCacheMode(CacheMode.PARTITIONED); ccfg.setBackups(2); ccfg.setNearConfiguration(null); ccfg.setAtomicityMode(TRANSACTIONAL); return ccfg; } }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration cacheCfg = defaultCacheConfiguration(); cacheCfg.setCacheMode(PARTITIONED); cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); cacheCfg.setRebalanceMode(SYNC); cacheCfg.setBackups(BACKUPS); cacheCfg.setAtomicityMode(TRANSACTIONAL); cfg.setCacheConfiguration(cacheCfg); return cfg; }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration cache = new CacheConfiguration(DEFAULT_CACHE_NAME); cache.setCacheMode(PARTITIONED); cache.setAtomicityMode(ATOMIC); cache.setWriteSynchronizationMode(FULL_SYNC); cache.setBackups(1); cache.setRebalanceMode(SYNC); cfg.setCacheConfiguration(cache); return cfg; }
/** {@inheritDoc} */ @Override protected CacheConfiguration<Integer, Integer> getCacheConfiguration() { return new CacheConfiguration<Integer, Integer>(CACHE_NAME) .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) .setCacheMode(CacheMode.PARTITIONED) .setBackups(1) .setAffinity(new RendezvousAffinityFunction(true /* machine-safe */, 1024)) .setRebalanceMode(CacheRebalanceMode.SYNC) .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); }
/** * @param name Name. */ private CacheConfiguration configuration(String name) { return new CacheConfiguration(name). setCacheMode(CacheMode.PARTITIONED). setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL). setBackups(1). setRebalanceBatchSize(1). setAffinity(new TestAffinityFunction().setPartitions(32)); }
/** {@inheritDoc} */ @Override protected CacheConfiguration cacheConfiguration() { CacheConfiguration cc = defaultCacheConfiguration(); cc.setNearConfiguration(null); cc.setAtomicityMode(atomicityMode()); cc.setName(CACHE_NAME); cc.setCacheMode(REPLICATED); cc.setWriteSynchronizationMode(FULL_SYNC); cc.setRebalanceMode(SYNC); cc.setRebalanceBatchSize(20); return cc; }