use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class JdbcThinAuthenticateConnectionSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("deprecation")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(disco);
cfg.setMarshaller(new BinaryMarshaller());
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 StandaloneGridKernalContext method prepareIgniteConfiguration.
/**
* @return Ignite configuration which allows to start requied processors for WAL reader
*/
private IgniteConfiguration prepareIgniteConfiguration() {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setDiscoverySpi(new StandaloneNoopDiscoverySpi());
cfg.setCommunicationSpi(new StandaloneNoopCommunicationSpi());
final Marshaller marshaller = new BinaryMarshaller();
cfg.setMarshaller(marshaller);
final DataStorageConfiguration pstCfg = new DataStorageConfiguration();
final DataRegionConfiguration regCfg = new DataRegionConfiguration();
regCfg.setPersistenceEnabled(true);
pstCfg.setDefaultDataRegionConfiguration(regCfg);
cfg.setDataStorageConfiguration(pstCfg);
marshaller.setContext(marshallerCtx);
return cfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class IgniteCacheDatabaseSharedManager method ensureFreeSpace.
/**
* See {@link GridCacheMapEntry#ensureFreeSpace()}
*
* @param memPlc data region.
*/
public void ensureFreeSpace(DataRegion memPlc) throws IgniteCheckedException {
if (memPlc == null)
return;
DataRegionConfiguration plcCfg = memPlc.config();
if (plcCfg.getPageEvictionMode() == DataPageEvictionMode.DISABLED || plcCfg.isPersistenceEnabled())
return;
long memorySize = plcCfg.getMaxSize();
PageMemory pageMem = memPlc.pageMemory();
int sysPageSize = pageMem.systemPageSize();
CacheFreeListImpl freeListImpl = freeListMap.get(plcCfg.getName());
for (; ; ) {
long allocatedPagesCnt = pageMem.loadedPages();
int emptyDataPagesCnt = freeListImpl.emptyDataPages();
boolean shouldEvict = allocatedPagesCnt > (memorySize / sysPageSize * plcCfg.getEvictionThreshold()) && emptyDataPagesCnt < plcCfg.getEmptyPagesPoolSize();
if (shouldEvict) {
memPlc.evictionTracker().evictDataPage();
memPlc.memoryMetrics().updateEvictionRate();
} else
break;
}
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class IgniteCacheDatabaseSharedManager method validateConfiguration.
/**
* @param memCfg configuration to validate.
*/
private void validateConfiguration(DataStorageConfiguration memCfg) throws IgniteCheckedException {
checkPageSize(memCfg);
DataRegionConfiguration[] regCfgs = memCfg.getDataRegionConfigurations();
Set<String> regNames = (regCfgs != null) ? U.<String>newHashSet(regCfgs.length) : new HashSet<String>(0);
checkSystemDataRegionSizeConfiguration(memCfg.getSystemRegionInitialSize(), memCfg.getSystemRegionMaxSize());
if (regCfgs != null) {
for (DataRegionConfiguration regCfg : regCfgs) checkDataRegionConfiguration(memCfg, regNames, regCfg);
}
checkDataRegionConfiguration(memCfg, regNames, memCfg.getDefaultDataRegionConfiguration());
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class IgniteCacheDatabaseSharedManager method registerMetricsMBeans.
/**
* Registers MBeans for all DataRegionMetrics configured in this instance.
*/
private void registerMetricsMBeans() {
if (U.IGNITE_MBEANS_DISABLED)
return;
IgniteConfiguration cfg = cctx.gridConfig();
for (DataRegionMetrics memMetrics : memMetricsMap.values()) {
DataRegionConfiguration memPlcCfg = dataRegionMap.get(memMetrics.getName()).config();
registerMetricsMBean((DataRegionMetricsImpl) memMetrics, memPlcCfg, cfg);
}
}
Aggregations