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 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;
}
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 DataStreamProcessorSelfTest method getConfiguration.
/** {@inheritDoc} */
@SuppressWarnings({ "IfMayBeConditional", "unchecked" })
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setPeerClassLoadingEnabled(false);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setForceServerMode(true);
spi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(spi);
cfg.setIncludeProperties();
if (useCache) {
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(mode);
cc.setAtomicityMode(TRANSACTIONAL);
if (nearEnabled) {
NearCacheConfiguration nearCfg = new NearCacheConfiguration();
cc.setNearConfiguration(nearCfg);
}
cc.setWriteSynchronizationMode(FULL_SYNC);
if (store != null) {
cc.setCacheStoreFactory(new IgniteReflectionFactory<CacheStore>(TestStore.class));
cc.setReadThrough(true);
cc.setWriteThrough(true);
}
cfg.setCacheConfiguration(cc);
} else {
cfg.setCacheConfiguration();
cfg.setClientMode(true);
}
return cfg;
}
Aggregations