use of org.apache.ignite.internal.processors.cache.warmup.WarmUpStrategy in project ignite by apache.
the class IgniteCacheDatabaseSharedManager method validateConfiguration.
/**
* @param memCfg configuration to validate.
* @throws IgniteCheckedException In case of validation violation.
*/
private void validateConfiguration(DataStorageConfiguration memCfg) throws IgniteCheckedException {
checkPageSize(memCfg);
DataRegionConfiguration[] regCfgs = memCfg.getDataRegionConfigurations();
Set<String> regNames = new HashSet<>();
checkSystemDataRegionSizeConfiguration(memCfg.getSystemDataRegionConfiguration().getInitialSize(), memCfg.getSystemDataRegionConfiguration().getMaxSize());
Map<Class<? extends WarmUpConfiguration>, WarmUpStrategy> warmUpStrategies = CU.warmUpStrategies(cctx.kernalContext());
if (regCfgs != null) {
for (DataRegionConfiguration regCfg : regCfgs) checkDataRegionConfiguration(memCfg, regNames, regCfg, warmUpStrategies);
}
checkDataRegionConfiguration(memCfg, regNames, memCfg.getDefaultDataRegionConfiguration(), warmUpStrategies);
checkWalArchiveSizeConfiguration(memCfg, log);
checkExistenceWarmUpConfiguration(memCfg.getDefaultWarmUpConfiguration(), warmUpStrategies, (warmUpCfg) -> "Unknown default warm-up configuration: " + warmUpCfg);
}
use of org.apache.ignite.internal.processors.cache.warmup.WarmUpStrategy in project ignite by apache.
the class GridCacheUtils method warmUpStrategies.
/**
* Getting available warming strategies.
*
* @param kernalCtx Kernal context.
* @return Mapping configuration to strategy.
*/
public static Map<Class<? extends WarmUpConfiguration>, WarmUpStrategy> warmUpStrategies(GridKernalContext kernalCtx) {
Map<Class<? extends WarmUpConfiguration>, WarmUpStrategy> strategies = new HashMap<>();
// Adding default strategies.
WarmUpStrategy[] defStrats = { new NoOpWarmUpStrategy(), new LoadAllWarmUpStrategy(kernalCtx.log(LoadAllWarmUpStrategy.class), () -> kernalCtx.cache().cacheGroups()) };
for (WarmUpStrategy<?> strategy : defStrats) strategies.putIfAbsent(strategy.configClass(), strategy);
// Adding strategies from plugins.
WarmUpStrategySupplier[] suppliers = kernalCtx.plugins().extensions(WarmUpStrategySupplier.class);
if (nonNull(suppliers)) {
for (WarmUpStrategySupplier supplier : suppliers) {
for (WarmUpStrategy<?> strategy : supplier.strategies()) strategies.putIfAbsent(strategy.configClass(), strategy);
}
}
return strategies;
}
Aggregations