use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class PagesWriteThrottleSandboxTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
TcpDiscoverySpi discoverySpi = (TcpDiscoverySpi) cfg.getDiscoverySpi();
discoverySpi.setIpFinder(ipFinder);
DataStorageConfiguration dbCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(4000L * 1024 * 1024).setCheckpointPageBufferSize(1000L * 1000 * 1000).setName("dfltDataRegion").setMetricsEnabled(true).setPersistenceEnabled(true)).setWalMode(WALMode.BACKGROUND).setCheckpointFrequency(20_000).setWriteThrottlingEnabled(true);
cfg.setDataStorageConfiguration(dbCfg);
CacheConfiguration ccfg1 = new CacheConfiguration();
ccfg1.setName(CACHE_NAME);
ccfg1.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
ccfg1.setAffinity(new RendezvousAffinityFunction(false, 64));
cfg.setCacheConfiguration(ccfg1);
cfg.setConsistentId(gridName);
return cfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class IgniteOutOfMemoryPropagationTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
DataStorageConfiguration memCfg = new DataStorageConfiguration();
memCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(10 * 1024 * 1024 + 1));
cfg.setDataStorageConfiguration(memCfg);
CacheConfiguration<Object, Object> baseCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
baseCfg.setAtomicityMode(this.atomicityMode);
baseCfg.setCacheMode(this.mode);
baseCfg.setBackups(this.backupsCnt);
baseCfg.setWriteSynchronizationMode(this.writeSyncMode);
cfg.setCacheConfiguration(baseCfg);
return cfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class IgnitePdsCacheRebalancingAbstractTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
cfg.setConsistentId(gridName);
CacheConfiguration ccfg1 = cacheConfiguration(cacheName).setPartitionLossPolicy(PartitionLossPolicy.READ_WRITE_SAFE).setBackups(2).setRebalanceMode(CacheRebalanceMode.ASYNC).setIndexedTypes(Integer.class, Integer.class).setAffinity(new RendezvousAffinityFunction(false, 32)).setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
CacheConfiguration ccfg2 = cacheConfiguration("indexed");
ccfg2.setBackups(1);
ccfg2.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
QueryEntity qryEntity = new QueryEntity(Integer.class.getName(), TestValue.class.getName());
LinkedHashMap<String, String> fields = new LinkedHashMap<>();
fields.put("v1", Integer.class.getName());
fields.put("v2", Integer.class.getName());
qryEntity.setFields(fields);
QueryIndex qryIdx = new QueryIndex("v1", true);
qryEntity.setIndexes(Collections.singleton(qryIdx));
ccfg2.setQueryEntities(Collections.singleton(qryEntity));
// Do not start filtered cache on coordinator.
if (gridName.endsWith("0")) {
cfg.setCacheConfiguration(ccfg1, ccfg2);
} else {
CacheConfiguration ccfg3 = cacheConfiguration("filtered");
ccfg3.setPartitionLossPolicy(PartitionLossPolicy.READ_ONLY_SAFE);
ccfg3.setBackups(1);
ccfg3.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
ccfg3.setNodeFilter(new CoordinatorNodeFilter());
cfg.setCacheConfiguration(ccfg1, ccfg2, ccfg3);
}
DataStorageConfiguration memCfg = new DataStorageConfiguration();
memCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
memCfg.setPageSize(1024);
memCfg.setWalMode(WALMode.LOG_ONLY);
DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
memPlcCfg.setName("dfltDataRegion");
memPlcCfg.setMaxSize(150 * 1024 * 1024);
memPlcCfg.setInitialSize(100 * 1024 * 1024);
memPlcCfg.setSwapPath("work/swap");
memPlcCfg.setPersistenceEnabled(true);
memCfg.setDefaultDataRegionConfiguration(memPlcCfg);
cfg.setDataStorageConfiguration(memCfg);
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));
return cfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class IgnitePdsPageReplacementTest method createDbConfig.
/**
* @return DB config.
*/
private DataStorageConfiguration createDbConfig() {
final DataStorageConfiguration memCfg = new DataStorageConfiguration();
DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
memPlcCfg.setInitialSize(MEMORY_LIMIT);
memPlcCfg.setMaxSize(MEMORY_LIMIT);
memPlcCfg.setPageEvictionMode(DataPageEvictionMode.RANDOM_LRU);
memPlcCfg.setName("dfltDataRegion");
memPlcCfg.setPersistenceEnabled(true);
memCfg.setPageSize(PAGE_SIZE);
memCfg.setConcurrencyLevel(NUMBER_OF_SEGMENTS);
memCfg.setDefaultDataRegionConfiguration(memPlcCfg);
memCfg.setWalMode(WALMode.LOG_ONLY);
return memCfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class PageEvictionAbstractTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
DataStorageConfiguration dbCfg = new DataStorageConfiguration();
DataRegionConfiguration plc = new DataRegionConfiguration();
// This will test additional segment allocation.
plc.setInitialSize(SIZE / 2);
plc.setMaxSize(SIZE);
plc.setEmptyPagesPoolSize(EMPTY_PAGES_POOL_SIZE);
plc.setEvictionThreshold(EVICTION_THRESHOLD);
plc.setName(DEFAULT_POLICY_NAME);
dbCfg.setDefaultDataRegionConfiguration(plc);
dbCfg.setPageSize(PAGE_SIZE);
cfg.setDataStorageConfiguration(dbCfg);
return cfg;
}
Aggregations