use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class PlatformConfigurationUtils method readDataStorageConfiguration.
/**
* Reads the data storage configuration.
*
* @param in Reader.
* @return Config.
*/
private static DataStorageConfiguration readDataStorageConfiguration(BinaryRawReader in) {
DataStorageConfiguration res = new DataStorageConfiguration().setStoragePath(in.readString()).setCheckpointFrequency(in.readLong()).setCheckpointThreads(in.readInt()).setLockWaitTime((int) in.readLong()).setWalHistorySize(in.readInt()).setWalSegments(in.readInt()).setWalSegmentSize(in.readInt()).setWalPath(in.readString()).setWalArchivePath(in.readString()).setWalMode(WALMode.fromOrdinal(in.readInt())).setWalThreadLocalBufferSize(in.readInt()).setWalFlushFrequency((int) in.readLong()).setWalFsyncDelayNanos(in.readLong()).setWalRecordIteratorBufferSize(in.readInt()).setAlwaysWriteFullPages(in.readBoolean()).setMetricsEnabled(in.readBoolean()).setMetricsSubIntervalCount(in.readInt()).setMetricsRateTimeInterval(in.readLong()).setCheckpointWriteOrder(CheckpointWriteOrder.fromOrdinal(in.readInt())).setWriteThrottlingEnabled(in.readBoolean()).setWalCompactionEnabled(in.readBoolean()).setSystemRegionInitialSize(in.readLong()).setSystemRegionMaxSize(in.readLong()).setPageSize(in.readInt()).setConcurrencyLevel(in.readInt()).setWalAutoArchiveAfterInactivity(in.readLong());
int cnt = in.readInt();
if (cnt > 0) {
DataRegionConfiguration[] regs = new DataRegionConfiguration[cnt];
for (int i = 0; i < cnt; i++) {
regs[i] = readDataRegionConfiguration(in);
}
res.setDataRegionConfigurations(regs);
}
if (in.readBoolean()) {
res.setDefaultDataRegionConfiguration(readDataRegionConfiguration(in));
}
return res;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class JettyRestProcessorAbstractSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
FileSystemConfiguration igfs = new FileSystemConfiguration();
igfs.setName("igfs");
igfs.setIpcEndpointConfiguration(new IgfsIpcEndpointConfiguration());
cfg.setFileSystemConfiguration(igfs);
DataStorageConfiguration dsCfg = new DataStorageConfiguration();
DataRegionConfiguration drCfg = new DataRegionConfiguration();
drCfg.setName("testDataRegion");
drCfg.setMaxSize(100 * 1024 * 1024);
dsCfg.setDefaultDataRegionConfiguration(drCfg);
cfg.setDataStorageConfiguration(dsCfg);
return cfg;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class JettyRestProcessorAuthenticationSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setAuthenticationEnabled(true);
// For now persistence is needed because of current authentication implementation.
DataStorageConfiguration dsCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024)).setWalMode(NONE);
DataRegionConfiguration testDataRegionCfg = new DataRegionConfiguration();
testDataRegionCfg.setName("testDataRegion");
testDataRegionCfg.setMaxSize(10 * 1024 * 1024);
DataRegionConfiguration authDataRegionCfg = new DataRegionConfiguration();
authDataRegionCfg.setName("authDataRegion").setMaxSize(10 * 1024 * 1024).setPersistenceEnabled(true);
dsCfg.setDataRegionConfigurations(testDataRegionCfg, authDataRegionCfg);
cfg.setDataStorageConfiguration(dsCfg);
return cfg;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class NonAffinityCoordinatorDynamicStartStopTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
TcpDiscoverySpi discoverySpi = (TcpDiscoverySpi) cfg.getDiscoverySpi();
discoverySpi.setIpFinder(ipFinder);
DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(200 * 1024 * 1024));
cfg.setDataStorageConfiguration(memCfg);
if (gridName.contains(DUMMY_GRID_NAME))
cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE, false));
else
cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE, true));
cfg.setConsistentId(gridName);
if (gridName.contains("client"))
cfg.setClientMode(true);
return cfg;
}
use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.
the class IgnitePdsDiskErrorsRecoveringTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
DataStorageConfiguration dsCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(WALMode.LOG_ONLY).setWalCompactionEnabled(false).setWalSegmentSize(WAL_SEGMENT_SIZE).setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
if (failPageStoreDiskOperations)
dsCfg.setFileIOFactory(new LimitedSizeFileIOFactory(new RandomAccessFileIOFactory(), diskSpaceBytes));
cfg.setDataStorageConfiguration(dsCfg);
CacheConfiguration cacheCfg = new CacheConfiguration(CACHE_NAME).setRebalanceMode(CacheRebalanceMode.NONE).setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL).setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC).setAffinity(new RendezvousAffinityFunction(false, 1));
cfg.setCacheConfiguration(cacheCfg);
return cfg;
}
Aggregations