use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class IgniteDbAbstractTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
DataStorageConfiguration dbCfg = new DataStorageConfiguration();
if (client)
cfg.setClientMode(true);
dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
if (isLargePage())
dbCfg.setPageSize(16 * 1024);
else
dbCfg.setPageSize(4 * 1024);
dbCfg.setWalMode(WALMode.LOG_ONLY);
dbCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setName("default"));
configure(dbCfg);
cfg.setDataStorageConfiguration(dbCfg);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
if (indexingEnabled())
ccfg.setIndexedTypes(Integer.class, DbValue.class);
ccfg.setAtomicityMode(TRANSACTIONAL);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setRebalanceMode(SYNC);
ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
CacheConfiguration ccfg2 = new CacheConfiguration("non-primitive");
if (indexingEnabled())
ccfg2.setIndexedTypes(DbKey.class, DbValue.class);
ccfg2.setAtomicityMode(TRANSACTIONAL);
ccfg2.setWriteSynchronizationMode(FULL_SYNC);
ccfg2.setRebalanceMode(SYNC);
ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32));
CacheConfiguration ccfg3 = new CacheConfiguration("large");
if (indexingEnabled())
ccfg3.setIndexedTypes(Integer.class, LargeDbValue.class);
ccfg3.setAtomicityMode(TRANSACTIONAL);
ccfg3.setWriteSynchronizationMode(FULL_SYNC);
ccfg3.setRebalanceMode(SYNC);
ccfg3.setAffinity(new RendezvousAffinityFunction(false, 32));
CacheConfiguration ccfg4 = new CacheConfiguration("tiny");
ccfg4.setAtomicityMode(TRANSACTIONAL);
ccfg4.setWriteSynchronizationMode(FULL_SYNC);
ccfg4.setRebalanceMode(SYNC);
ccfg4.setAffinity(new RendezvousAffinityFunction(1, null));
CacheConfiguration ccfg5 = new CacheConfiguration("atomic");
if (indexingEnabled())
ccfg5.setIndexedTypes(DbKey.class, DbValue.class);
ccfg5.setAtomicityMode(ATOMIC);
ccfg5.setWriteSynchronizationMode(FULL_SYNC);
ccfg5.setRebalanceMode(SYNC);
ccfg5.setAffinity(new RendezvousAffinityFunction(false, 32));
if (!client)
cfg.setCacheConfiguration(ccfg, ccfg2, ccfg3, ccfg4, ccfg5);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
cfg.setMarshaller(null);
configure(cfg);
return cfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class SwapPathConstructionSelfTest method createMemoryConfiguration.
/**
* @param isRelativePath flag is set to {@code true} if relative path should be used for data region configuration.
*/
private DataStorageConfiguration createMemoryConfiguration(boolean isRelativePath) {
DataStorageConfiguration memCfg = new DataStorageConfiguration();
DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
memPlcCfg.setName("default");
memPlcCfg.setMaxSize(20 * 1024 * 1024);
if (isRelativePath)
memPlcCfg.setSwapPath(RELATIVE_SWAP_PATH);
else
memPlcCfg.setSwapPath(Paths.get(getTmpDir(), ABSOLUTE_SWAP_PATH).toString());
memCfg.setDefaultDataRegionConfiguration(memPlcCfg);
return memCfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class TxPessimisticDeadlockDetectionTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
if (isDebug()) {
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.failureDetectionTimeoutEnabled(false);
cfg.setDiscoverySpi(discoSpi);
}
DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_MAX_SIZE * 10).setName("dfltPlc"));
cfg.setDataStorageConfiguration(memCfg);
cfg.setClientMode(client);
return cfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class DataRegionMetricsSelfTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
DataRegionConfiguration plcCfg = new DataRegionConfiguration();
memMetrics = new DataRegionMetricsImpl(plcCfg);
memMetrics.enableMetrics();
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class BPlusTreeBenchmark method createPageMemory.
/**
* @return Page memory.
* @throws Exception If failed.
*/
private PageMemory createPageMemory() throws Exception {
long[] sizes = new long[CPUS];
for (int i = 0; i < sizes.length; i++) sizes[i] = 1024 * MB / CPUS;
DataRegionConfiguration plcCfg = new DataRegionConfiguration().setMaxSize(1024 * MB);
PageMemory pageMem = new PageMemoryNoStoreImpl(new JavaLogger(), new UnsafeMemoryProvider(new JavaLogger()), null, PAGE_SIZE, plcCfg, new DataRegionMetricsImpl(plcCfg), false);
pageMem.start();
return pageMem;
}
Aggregations