use of org.apache.ignite.configuration.DataRegionConfiguration 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.DataRegionConfiguration 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;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class IgniteMetaStorageBasicTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
DataStorageConfiguration storageCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(WALMode.LOG_ONLY);
cfg.setDataStorageConfiguration(storageCfg);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
return cfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class BPlusTreePageMemoryImplTest method createPageMemory.
/**
* {@inheritDoc}
*/
@Override
protected PageMemory createPageMemory() throws Exception {
long[] sizes = new long[CPUS + 1];
for (int i = 0; i < sizes.length; i++) sizes[i] = 1024 * MB / CPUS;
sizes[CPUS] = 10 * MB;
DirectMemoryProvider provider = new UnsafeMemoryProvider(log);
GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(new GridTestKernalContext(log), null, null, null, new NoOpPageStoreManager(), new NoOpWALManager(), null, new IgniteCacheDatabaseSharedManager(), null, null, null, null, null, null, null, null);
PageMemory mem = new PageMemoryImpl(provider, sizes, sharedCtx, PAGE_SIZE, (fullPageId, byteBuf, tag) -> {
assert false : "No page replacement should happen during the test";
}, new CIX3<Long, FullPageId, PageMemoryEx>() {
@Override
public void applyx(Long aLong, FullPageId fullPageId, PageMemoryEx ex) {
}
}, () -> true, new DataRegionMetricsImpl(new DataRegionConfiguration()), PageMemoryImpl.ThrottlingPolicy.DISABLED, null);
mem.start();
return mem;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class BPlusTreeReuseListPageMemoryImplTest method createPageMemory.
/**
* {@inheritDoc}
*/
@Override
protected PageMemory createPageMemory() throws Exception {
long[] sizes = new long[CPUS + 1];
for (int i = 0; i < sizes.length; i++) sizes[i] = 1024 * MB / CPUS;
sizes[CPUS] = 10 * MB;
DirectMemoryProvider provider = new UnsafeMemoryProvider(log);
GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(new GridTestKernalContext(log), null, null, null, new NoOpPageStoreManager(), new NoOpWALManager(), null, new IgniteCacheDatabaseSharedManager(), null, null, null, null, null, null, null, null);
PageMemory mem = new PageMemoryImpl(provider, sizes, sharedCtx, PAGE_SIZE, (fullPageId, byteBuf, tag) -> {
assert false : "No page replacement (rotation with disk) should happen during the test";
}, new GridInClosure3X<Long, FullPageId, PageMemoryEx>() {
@Override
public void applyx(Long page, FullPageId fullPageId, PageMemoryEx pageMem) {
}
}, () -> true, new DataRegionMetricsImpl(new DataRegionConfiguration()), PageMemoryImpl.ThrottlingPolicy.DISABLED, null);
mem.start();
return mem;
}
Aggregations