use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class IgnitePdsCheckpointSimulationWithRealCpDisabledTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
CacheConfiguration ccfg = new CacheConfiguration(cacheName);
ccfg.setRebalanceMode(CacheRebalanceMode.NONE);
cfg.setCacheConfiguration(ccfg);
cfg.setDataStorageConfiguration(new DataStorageConfiguration().setCheckpointFrequency(500).setWalMode(WALMode.LOG_ONLY).setAlwaysWriteFullPages(true).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
return cfg;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class IgnitePdsThreadInterruptionTest method storageConfiguration.
/**
* @return DataStorage configuration.
*/
private DataStorageConfiguration storageConfiguration() {
DataRegionConfiguration regionCfg = new DataRegionConfiguration().setInitialSize(10L * 1024L * 1024L).setMaxSize(10L * 1024L * 1024L).setPageEvictionMode(DataPageEvictionMode.RANDOM_LRU);
DataStorageConfiguration cfg = new DataStorageConfiguration().setWalMode(WALMode.LOG_ONLY).setWalFsyncDelayNanos(0).setPageSize(PAGE_SIZE).setFileIOFactory(new AsyncFileIOFactory());
cfg.setDefaultDataRegionConfiguration(regionCfg);
return cfg;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class IgniteUidAsConsistentIdMigrationTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
final IgniteConfiguration cfg = super.getConfiguration(gridName);
if (configuredConsistentId != null)
cfg.setConsistentId(configuredConsistentId);
final DataStorageConfiguration dsCfg = new DataStorageConfiguration();
if (placeStorageInTemp) {
final File tempDir = new File(System.getProperty("java.io.tmpdir"));
pstStoreCustomPath = new File(tempDir, "Store");
pstWalStoreCustomPath = new File(tempDir, "WalStore");
pstWalArchCustomPath = new File(tempDir, "WalArchive");
dsCfg.setStoragePath(pstStoreCustomPath.getAbsolutePath());
dsCfg.setWalPath(pstWalStoreCustomPath.getAbsolutePath());
dsCfg.setWalArchivePath(pstWalArchCustomPath.getAbsolutePath());
}
dsCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(32 * 1024 * 1024).setPersistenceEnabled(true));
cfg.setDataStorageConfiguration(dsCfg);
if (strLog != null)
cfg.setGridLogger(strLog);
return cfg;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class IgniteWalRecoveryPPCTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
CacheConfiguration<Integer, IndexedObject> ccfg = new CacheConfiguration<>(CACHE_NAME_1);
ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
cfg.setCacheConfiguration(ccfg);
CacheConfiguration<Integer, IndexedObject> ccfg2 = new CacheConfiguration<>(CACHE_NAME_2);
ccfg2.setAtomicityMode(CacheAtomicityMode.ATOMIC);
ccfg2.setRebalanceMode(CacheRebalanceMode.SYNC);
ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32));
ccfg2.setDataRegionName(MEM_PLC_NO_PDS);
cfg.setCacheConfiguration(ccfg, ccfg2);
DataStorageConfiguration dbCfg = new DataStorageConfiguration();
dbCfg.setPageSize(4 * 1024);
DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
memPlcCfg.setInitialSize(1024 * 1024 * 1024);
memPlcCfg.setMaxSize(1024 * 1024 * 1024);
memPlcCfg.setPersistenceEnabled(true);
dbCfg.setDefaultDataRegionConfiguration(memPlcCfg);
DataRegionConfiguration memPlcCfg2 = new DataRegionConfiguration();
memPlcCfg2.setName(MEM_PLC_NO_PDS);
memPlcCfg2.setInitialSize(1024 * 1024 * 1024);
memPlcCfg2.setMaxSize(1024 * 1024 * 1024);
memPlcCfg2.setPersistenceEnabled(false);
dbCfg.setDataRegionConfigurations(memPlcCfg2);
dbCfg.setWalRecordIteratorBufferSize(1024 * 1024);
dbCfg.setWalHistorySize(2);
dbCfg.setWalMode(WALMode.LOG_ONLY);
if (walSegmentSize != 0)
dbCfg.setWalSegmentSize(walSegmentSize);
cfg.setDataStorageConfiguration(dbCfg);
cfg.setMarshaller(null);
BinaryConfiguration binCfg = new BinaryConfiguration();
binCfg.setCompactFooter(false);
cfg.setBinaryConfiguration(binCfg);
return cfg;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class IgniteWalReaderTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
final IgniteConfiguration cfg = super.getConfiguration(gridName);
final CacheConfiguration<Integer, IndexedObject> ccfg = new CacheConfiguration<>(CACHE_NAME);
ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
ccfg.setIndexedTypes(Integer.class, IndexedObject.class);
cfg.setCacheConfiguration(ccfg);
cfg.setIncludeEventTypes(EventType.EVT_WAL_SEGMENT_ARCHIVED);
DataStorageConfiguration dsCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(1024 * 1024 * 1024).setPersistenceEnabled(true)).setPageSize(PAGE_SIZE).setWalHistorySize(1).setWalSegmentSize(1024 * 1024).setWalSegments(WAL_SEGMENTS).setWalMode(customWalMode != null ? customWalMode : WALMode.BACKGROUND);
if (archiveIncompleteSegmentAfterInactivityMs > 0)
dsCfg.setWalAutoArchiveAfterInactivity(archiveIncompleteSegmentAfterInactivityMs);
final String workDir = U.defaultWorkDirectory();
final File db = U.resolveWorkDirectory(workDir, DFLT_STORE_DIR, false);
final File wal = new File(db, "wal");
if (setWalAndArchiveToSameValue) {
final String walAbsPath = wal.getAbsolutePath();
dsCfg.setWalPath(walAbsPath);
dsCfg.setWalArchivePath(walAbsPath);
} else {
dsCfg.setWalPath(wal.getAbsolutePath());
dsCfg.setWalArchivePath(new File(wal, "archive").getAbsolutePath());
}
cfg.setDataStorageConfiguration(dsCfg);
return cfg;
}
Aggregations