use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class GridAffinitySelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(disco);
cfg.setFailureDetectionTimeout(Integer.MAX_VALUE);
if (igniteInstanceName.endsWith("1"))
cfg.setClientMode(true);
else {
assert igniteInstanceName.endsWith("2");
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setBackups(1);
cfg.setCacheConfiguration(cacheCfg);
}
return cfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class BinaryTreeSelfTest method configuration.
/**
* Create configuration.
*
* @param name Node name.
* @param client Client mode flag.
* @return Configuration.
*/
private static IgniteConfiguration configuration(String name, boolean client) {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName(name);
cfg.setClientMode(client);
cfg.setLocalHost("127.0.0.1");
cfg.setPeerClassLoadingEnabled(false);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Collections.singletonList("127.0.0.1:47500"));
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setCacheMode(CacheMode.PARTITIONED);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class GridBinaryAffinityKeySelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();
typeCfg.setTypeName(TestObject.class.getName());
BinaryConfiguration bCfg = new BinaryConfiguration();
bCfg.setTypeConfigurations(Collections.singleton(typeCfg));
cfg.setBinaryConfiguration(bCfg);
CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(TestObject.class.getName(), "affKey");
CacheKeyConfiguration keyCfg2 = new CacheKeyConfiguration("TestObject2", "affKey");
cfg.setCacheKeyConfiguration(keyCfg, keyCfg2);
cfg.setMarshaller(new BinaryMarshaller());
if (!igniteInstanceName.equals(getTestIgniteInstanceName(GRID_CNT))) {
CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
cacheCfg.setCacheMode(PARTITIONED);
cfg.setCacheConfiguration(cacheCfg);
}
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
return cfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class GridCacheMixedPartitionExchangeSelfTest method cacheConfiguration.
/**
* @return Cache configuration.
*/
private CacheConfiguration cacheConfiguration() {
CacheConfiguration ccfg = defaultCacheConfiguration();
ccfg.setCacheMode(PARTITIONED);
ccfg.setAtomicityMode(TRANSACTIONAL);
ccfg.setNearConfiguration(null);
ccfg.setBackups(1);
return ccfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class GridCacheMultinodeUpdateAbstractSelfTest method cacheConfiguration.
/** {@inheritDoc} */
@Override
protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception {
CacheConfiguration ccfg = super.cacheConfiguration(igniteInstanceName);
ccfg.setCacheStoreFactory(null);
ccfg.setReadThrough(false);
ccfg.setWriteThrough(false);
return ccfg;
}
Aggregations