use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class IgniteCacheDatabaseSharedManager method createSystemDataRegion.
/**
* @param sysCacheInitSize Initial size of PageMemory to be created for system cache.
* @param sysCacheMaxSize Maximum size of PageMemory to be created for system cache.
* @param persistenceEnabled Persistence enabled flag.
*
* @return {@link DataRegionConfiguration configuration} of DataRegion for system cache.
*/
private DataRegionConfiguration createSystemDataRegion(long sysCacheInitSize, long sysCacheMaxSize, boolean persistenceEnabled) {
DataRegionConfiguration res = new DataRegionConfiguration();
res.setName(SYSTEM_DATA_REGION_NAME);
res.setInitialSize(sysCacheInitSize);
res.setMaxSize(sysCacheMaxSize);
res.setPersistenceEnabled(persistenceEnabled);
return res;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class IgniteCacheDatabaseSharedManager method initPageMemoryDataStructures.
/**
* @param dbCfg Database config.
* @throws IgniteCheckedException If failed.
*/
protected void initPageMemoryDataStructures(DataStorageConfiguration dbCfg) throws IgniteCheckedException {
freeListMap = U.newHashMap(dataRegionMap.size());
String dfltMemPlcName = dbCfg.getDefaultDataRegionConfiguration().getName();
for (DataRegion memPlc : dataRegionMap.values()) {
DataRegionConfiguration memPlcCfg = memPlc.config();
DataRegionMetricsImpl memMetrics = (DataRegionMetricsImpl) memMetricsMap.get(memPlcCfg.getName());
boolean persistenceEnabled = memPlcCfg.isPersistenceEnabled();
CacheFreeListImpl freeList = new CacheFreeListImpl(0, cctx.igniteInstanceName(), memMetrics, memPlc, null, persistenceEnabled ? cctx.wal() : null, 0L, true);
freeListMap.put(memPlcCfg.getName(), freeList);
}
dfltFreeList = freeListMap.get(dfltMemPlcName);
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class IgniteCacheDatabaseSharedManager method initDataRegions.
/**
* @param memCfg Database config.
* @throws IgniteCheckedException If failed to initialize swap path.
*/
protected void initDataRegions(DataStorageConfiguration memCfg) throws IgniteCheckedException {
if (dataRegionsInitialized)
return;
DataRegionConfiguration[] dataRegionCfgs = memCfg.getDataRegionConfigurations();
int dataRegions = dataRegionCfgs == null ? 0 : dataRegionCfgs.length;
dataRegionMap = U.newHashMap(3 + dataRegions);
memMetricsMap = U.newHashMap(3 + dataRegions);
if (dataRegionCfgs != null) {
for (DataRegionConfiguration dataRegionCfg : dataRegionCfgs) addDataRegion(memCfg, dataRegionCfg, dataRegionCfg.isPersistenceEnabled());
}
addDataRegion(memCfg, memCfg.getDefaultDataRegionConfiguration(), memCfg.getDefaultDataRegionConfiguration().isPersistenceEnabled());
addDataRegion(memCfg, createSystemDataRegion(memCfg.getSystemRegionInitialSize(), memCfg.getSystemRegionMaxSize(), CU.isPersistenceEnabled(memCfg)), CU.isPersistenceEnabled(memCfg));
dataRegionsInitialized = true;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class Authentication1kUsersNodeRestartTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(spi);
cfg.setAuthenticationEnabled(true);
cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
return cfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class AuthenticationOnNotActiveClusterTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
if (getTestIgniteInstanceIndex(igniteInstanceName) == CLI_NODE)
cfg.setClientMode(true);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(spi);
cfg.setAuthenticationEnabled(true);
cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
return cfg;
}
Aggregations