use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class GridCacheQueueApiSelfAbstractTest method testSystemCache.
/**
* @throws Exception If failed.
*/
public void testSystemCache() throws Exception {
CollectionConfiguration colCfg = collectionConfiguration();
IgniteQueue queue = grid(0).queue("Queue1", 0, colCfg);
final CacheConfiguration ccfg = getQueueCache(queue);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override
public Object call() throws Exception {
grid(0).cache(ccfg.getName());
return null;
}
}, IllegalStateException.class, "Failed to get cache because it is a system cache");
assertNotNull(((IgniteKernal) grid(0)).internalCache(ccfg.getName()));
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class IgniteCrossCacheTxStoreSelfTest method cacheConfiguration.
/**
* @param cacheName Cache name.
* @param factory Factory to use.
* @return Cache configuration.
*/
private CacheConfiguration cacheConfiguration(String cacheName, Factory<CacheStore> factory) {
CacheConfiguration cfg = defaultCacheConfiguration();
cfg.setNearConfiguration(null);
cfg.setName(cacheName);
cfg.setBackups(1);
if (factory != null) {
cfg.setCacheStoreFactory(factory);
cfg.setWriteThrough(true);
}
return cfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class IgniteCacheSizeFailoverTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setCacheMode(PARTITIONED);
ccfg.setAtomicityMode(ATOMIC);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setBackups(1);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class IgniteCachePrimarySyncTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
CacheConfiguration<Object, Object> ccfg1 = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
ccfg1.setName("cache1");
ccfg1.setAtomicityMode(ATOMIC);
ccfg1.setBackups(2);
ccfg1.setWriteSynchronizationMode(PRIMARY_SYNC);
CacheConfiguration<Object, Object> ccfg2 = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
ccfg2.setName("cache2");
ccfg2.setAtomicityMode(TRANSACTIONAL);
ccfg2.setBackups(2);
ccfg2.setWriteSynchronizationMode(PRIMARY_SYNC);
cfg.setCacheConfiguration(ccfg1, ccfg2);
cfg.setClientMode(clientMode);
return cfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class IgniteCacheSystemTransactionsSelfTest method cacheConfiguration.
/** {@inheritDoc} */
@Override
protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception {
CacheConfiguration ccfg = super.cacheConfiguration(igniteInstanceName);
ccfg.setAtomicityMode(TRANSACTIONAL);
return ccfg;
}
Aggregations