use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class IgniteServiceDynamicCachesSelfTest method testDeployCalledBeforeCacheStart.
/**
* @throws Exception If failed.
*/
public void testDeployCalledBeforeCacheStart() throws Exception {
String cacheName = "cache";
CacheConfiguration ccfg = new CacheConfiguration(cacheName);
ccfg.setBackups(1);
Ignite ig = ignite(0);
final IgniteServices svcs = ig.services();
final String svcName = "myService";
ig.createCache(ccfg);
Object key = primaryKey(ig.cache(cacheName));
ig.destroyCache(cacheName);
awaitPartitionMapExchange();
svcs.deployKeyAffinitySingleton(svcName, new TestService(), cacheName, key);
assert svcs.service(svcName) == null;
ig.createCache(ccfg);
try {
boolean res = GridTestUtils.waitForCondition(new PA() {
@Override
public boolean apply() {
return svcs.service(svcName) != null;
}
}, 10 * 1000);
assertTrue("Service was not deployed", res);
info("stopping cache: " + cacheName);
ig.destroyCache(cacheName);
res = GridTestUtils.waitForCondition(new PA() {
@Override
public boolean apply() {
return svcs.service(svcName) == null;
}
}, 10 * 1000);
assertTrue("Service was not undeployed", res);
} finally {
ig.services().cancelAll();
ig.destroyCache(cacheName);
}
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class GridCacheDhtLockBackupSelfTest method cacheConfiguration.
/**
* @return Cache configuration.
*/
protected CacheConfiguration cacheConfiguration() {
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(CacheMode.PARTITIONED);
cacheCfg.setWriteSynchronizationMode(FULL_ASYNC);
cacheCfg.setRebalanceMode(SYNC);
return cacheCfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class IgniteHadoopFileSystemClientSelfTest method metaCacheConfiguration.
/**
* Gets cache configuration.
*
* @return Cache configuration.
*/
protected CacheConfiguration metaCacheConfiguration() {
CacheConfiguration ccfg = defaultCacheConfiguration();
ccfg.setName("replicated");
ccfg.setCacheMode(REPLICATED);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setEvictionPolicy(null);
ccfg.setAtomicityMode(TRANSACTIONAL);
return ccfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class IgniteHadoopFileSystemClientSelfTest method dataCacheConfiguration.
/**
* Gets cache configuration.
*
* @return Cache configuration.
*/
protected CacheConfiguration dataCacheConfiguration() {
CacheConfiguration ccfg = defaultCacheConfiguration();
ccfg.setName("partitioned");
ccfg.setCacheMode(PARTITIONED);
ccfg.setNearConfiguration(null);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setEvictionPolicy(null);
ccfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
ccfg.setBackups(0);
ccfg.setAtomicityMode(TRANSACTIONAL);
return ccfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class IgniteHadoopFileSystemIpcCacheSelfTest method metaCacheConfiguration.
/**
* Gets cache configuration.
*
* @return Cache configuration.
*/
private CacheConfiguration metaCacheConfiguration() {
CacheConfiguration ccfg = defaultCacheConfiguration();
ccfg.setName("replicated");
ccfg.setCacheMode(REPLICATED);
ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
ccfg.setAtomicityMode(TRANSACTIONAL);
return ccfg;
}
Aggregations