use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class MigratingToWalV2SerializerWithCompactionTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setPeerClassLoadingEnabled(false);
DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)).setWalSegmentSize(WAL_SEGMENT_SIZE).setWalCompactionEnabled(true).setWalMode(WALMode.LOG_ONLY).setWalHistorySize(200);
cfg.setDataStorageConfiguration(memCfg);
return cfg;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class IgniteKernal method ackMemoryConfiguration.
/**
*/
private void ackMemoryConfiguration() {
DataStorageConfiguration memCfg = cfg.getDataStorageConfiguration();
if (memCfg == null)
return;
U.log(log, "System cache's DataRegion size is configured to " + (memCfg.getSystemRegionInitialSize() / (1024 * 1024)) + " MB. " + "Use DataStorageConfiguration.systemCacheMemorySize property to change the setting.");
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class IgniteClusterActivateDeactivateTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
if (testReconnectSpi) {
TcpDiscoverySpi spi = new IgniteClientReconnectAbstractTest.TestTcpDiscoverySpi();
cfg.setDiscoverySpi(spi);
spi.setJoinTimeout(2 * 60_000);
}
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
cfg.setConsistentId(igniteInstanceName);
cfg.setClientMode(client);
cfg.setActiveOnStart(active);
if (ccfgs != null) {
cfg.setCacheConfiguration(ccfgs);
ccfgs = null;
}
DataStorageConfiguration memCfg = new DataStorageConfiguration();
memCfg.setPageSize(4 * 1024);
memCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(300 * 1024 * 1024).setPersistenceEnabled(persistenceEnabled()));
memCfg.setDataRegionConfigurations(new DataRegionConfiguration().setMaxSize(300 * 1024 * 1024).setName(NO_PERSISTENCE_REGION).setPersistenceEnabled(false));
if (persistenceEnabled())
memCfg.setWalMode(WALMode.LOG_ONLY);
cfg.setDataStorageConfiguration(memCfg);
if (testSpi) {
TestRecordingCommunicationSpi spi = new TestRecordingCommunicationSpi();
if (testSpiRecord != null)
spi.record(testSpiRecord);
cfg.setCommunicationSpi(spi);
}
return cfg;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class IgniteClusterActivateDeactivateTestWithPersistence method activateCachesRestore.
/**
* @param srvs Number of server nodes.
* @param withNewCaches If {@code true} then after restart has new caches in configuration.
* @throws Exception If failed.
*/
private void activateCachesRestore(int srvs, boolean withNewCaches) throws Exception {
Map<Integer, Integer> cacheData = startGridsAndLoadData(srvs);
stopAllGrids();
for (int i = 0; i < srvs; i++) {
if (withNewCaches)
ccfgs = cacheConfigurations2();
startGrid(i);
}
Ignite srv = ignite(0);
checkNoCaches(srvs);
srv.active(true);
final int CACHES = withNewCaches ? 4 : 2;
for (int i = 0; i < srvs; i++) {
for (int c = 0; c < CACHES; c++) checkCache(ignite(i), CACHE_NAME_PREFIX + c, true);
}
DataStorageConfiguration dsCfg = srv.configuration().getDataStorageConfiguration();
checkCachesData(cacheData, dsCfg);
checkCaches(srvs, CACHES);
int nodes = srvs;
client = false;
startGrid(nodes++);
for (int i = 0; i < nodes; i++) {
for (int c = 0; c < CACHES; c++) checkCache(ignite(i), CACHE_NAME_PREFIX + c, true);
}
checkCaches(nodes, CACHES);
client = true;
startGrid(nodes++);
for (int c = 0; c < CACHES; c++) checkCache(ignite(nodes - 1), CACHE_NAME_PREFIX + c, false);
checkCaches(nodes, CACHES);
for (int i = 0; i < nodes; i++) {
for (int c = 0; c < CACHES; c++) checkCache(ignite(i), CACHE_NAME_PREFIX + c, true);
}
checkCachesData(cacheData, dsCfg);
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class LargeEntryUpdateTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
cfg.setPublicThreadPoolSize(THREAD_COUNT);
DataStorageConfiguration mem = new DataStorageConfiguration();
mem.setPageSize(PAGE_SIZE);
cfg.setDataStorageConfiguration(mem);
CacheConfiguration[] ccfgs = new CacheConfiguration[CACHE_COUNT];
for (int i = 0; i < CACHE_COUNT; ++i) {
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setName(CACHE_PREFIX + i);
ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
ccfg.setCacheMode(CacheMode.PARTITIONED);
ccfgs[i] = ccfg;
}
cfg.setCacheConfiguration(ccfgs);
return cfg;
}
Aggregations