use of org.apache.ignite.configuration.NearCacheConfiguration in project ignite by apache.
the class GridCacheNearMultiNodeSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(ipFinder);
cfg.setFailureDetectionTimeout(Integer.MAX_VALUE);
cfg.setDiscoverySpi(spi);
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setCacheStoreFactory(singletonFactory(store));
cacheCfg.setReadThrough(true);
cacheCfg.setWriteThrough(true);
cacheCfg.setLoadPreviousValue(true);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setAffinity(aff);
cacheCfg.setAtomicityMode(atomicityMode());
cacheCfg.setBackups(BACKUPS);
cacheCfg.setNearConfiguration(new NearCacheConfiguration());
cfg.setCacheConfiguration(cacheCfg);
cfg.setUserAttributes(F.asMap(GridCacheModuloAffinityFunction.IDX_ATTR, cntr.getAndIncrement()));
return cfg;
}
use of org.apache.ignite.configuration.NearCacheConfiguration in project ignite by apache.
the class GridCachePartitionedMultiNodeCounterSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(spi);
// Default cache configuration.
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setRebalanceMode(NONE);
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setNearConfiguration(new NearCacheConfiguration());
cacheCfg.setAtomicityMode(TRANSACTIONAL);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setBackups(backups);
cfg.setCacheConfiguration(cacheCfg);
return cfg;
}
use of org.apache.ignite.configuration.NearCacheConfiguration in project ignite by apache.
the class GridCachePartitionedMultiNodeLockSelfTest method cacheConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected CacheConfiguration cacheConfiguration() {
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
// 2 backups, so all nodes are involved.
cc.setBackups(2);
cc.setAtomicityMode(TRANSACTIONAL);
cc.setNearConfiguration(new NearCacheConfiguration());
return cc;
}
use of org.apache.ignite.configuration.NearCacheConfiguration in project ignite by apache.
the class GridCachePartitionedOptimisticTxNodeRestartTest method cacheConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected CacheConfiguration cacheConfiguration() {
CacheConfiguration cc = defaultCacheConfiguration();
cc.setName(CACHE_NAME);
cc.setCacheMode(PARTITIONED);
cc.setWriteSynchronizationMode(FULL_SYNC);
cc.setRebalanceMode(rebalancMode);
cc.setRebalanceBatchSize(rebalancBatchSize);
cc.setAffinity(new RendezvousAffinityFunction(false, partitions));
cc.setBackups(backups);
cc.setNearConfiguration(nearEnabled() ? new NearCacheConfiguration() : null);
return cc;
}
use of org.apache.ignite.configuration.NearCacheConfiguration in project ignite by apache.
the class GridCachePartitionedTxMultiThreadedSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings({ "ConstantConditions" })
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
c.getTransactionConfiguration().setTxSerializableEnabled(true);
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
cc.setBackups(1);
cc.setEvictionPolicy(null);
cc.setWriteSynchronizationMode(FULL_SYNC);
cc.setNearConfiguration(nearEnabled() ? new NearCacheConfiguration() : null);
c.setCacheConfiguration(cc);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
c.setDiscoverySpi(disco);
if (CACHE_DEBUG)
resetLog4j(Level.DEBUG, true, GridCacheProcessor.class.getPackage().getName());
return c;
}
Aggregations