use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class MockWalIteratorFactory method iterator.
/**
* Creates iterator
* @param wal WAL directory without node consistent id
* @param walArchive WAL archive without node consistent id
* @return iterator
* @throws IgniteCheckedException if IO failed
*/
@SuppressWarnings("unchecked")
public WALIterator iterator(File wal, File walArchive) throws IgniteCheckedException {
final DataStorageConfiguration persistentCfg1 = Mockito.mock(DataStorageConfiguration.class);
when(persistentCfg1.getWalPath()).thenReturn(wal.getAbsolutePath());
when(persistentCfg1.getWalArchivePath()).thenReturn(walArchive.getAbsolutePath());
when(persistentCfg1.getWalSegments()).thenReturn(segments);
when(persistentCfg1.getWalBufferSize()).thenReturn(DataStorageConfiguration.DFLT_WAL_BUFF_SIZE);
when(persistentCfg1.getWalRecordIteratorBufferSize()).thenReturn(DataStorageConfiguration.DFLT_WAL_RECORD_ITERATOR_BUFFER_SIZE);
final FileIOFactory fileIOFactory = new DataStorageConfiguration().getFileIOFactory();
when(persistentCfg1.getFileIOFactory()).thenReturn(fileIOFactory);
final IgniteConfiguration cfg = Mockito.mock(IgniteConfiguration.class);
when(cfg.getDataStorageConfiguration()).thenReturn(persistentCfg1);
final GridKernalContext ctx = Mockito.mock(GridKernalContext.class);
when(ctx.config()).thenReturn(cfg);
when(ctx.clientNode()).thenReturn(false);
when(ctx.pdsFolderResolver()).thenReturn(new PdsFoldersResolver() {
@Override
public PdsFolderSettings resolveFolders() {
return new PdsFolderSettings(new File("."), subfolderName, consistentId, null, false);
}
});
final GridDiscoveryManager disco = Mockito.mock(GridDiscoveryManager.class);
when(ctx.discovery()).thenReturn(disco);
final IgniteWriteAheadLogManager mgr = new FileWriteAheadLogManager(ctx);
final GridCacheSharedContext sctx = Mockito.mock(GridCacheSharedContext.class);
when(sctx.kernalContext()).thenReturn(ctx);
when(sctx.discovery()).thenReturn(disco);
when(sctx.gridConfig()).thenReturn(cfg);
final GridCacheDatabaseSharedManager db = Mockito.mock(GridCacheDatabaseSharedManager.class);
when(db.pageSize()).thenReturn(pageSize);
when(sctx.database()).thenReturn(db);
when(sctx.logger(any(Class.class))).thenReturn(log);
mgr.start(sctx);
return mgr.replay(null);
}
use of org.apache.ignite.configuration.DataStorageConfiguration 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.DataStorageConfiguration in project ignite by apache.
the class IgnitePageMemReplaceDelayedWriteUnitTest method getConfiguration.
/**
* @param overallSize default region size in bytes
* @return configuration for test.
*/
@NotNull
private IgniteConfiguration getConfiguration(long overallSize) {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(overallSize)));
return cfg;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class IgnitePdsContinuousRestartTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(400 * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(WALMode.LOG_ONLY).setCheckpointFrequency(checkpointDelay);
cfg.setDataStorageConfiguration(memCfg);
CacheConfiguration ccfg1 = new CacheConfiguration();
ccfg1.setName(CACHE_NAME);
ccfg1.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
ccfg1.setAffinity(new RendezvousAffinityFunction(false, 128));
ccfg1.setBackups(2);
cfg.setCacheConfiguration(ccfg1);
return cfg;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class IgnitePdsDynamicCacheTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(200 * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(WALMode.LOG_ONLY).setPageSize(4 * 1024);
cfg.setDataStorageConfiguration(memCfg);
if ("client".equals(gridName))
cfg.setClientMode(true);
return cfg;
}
Aggregations