use of org.apache.ignite.configuration.WarmUpConfiguration in project ignite by apache.
the class WarmUpSelfTest method testAvailableWarmUpStrategies.
/**
* Test verifies that available warm-up strategies are correct.
* <p>
* Steps:
* 1)Starting a node, without plugins;
* 2)Check that only basic strategies are available;
* 3)Restarting a node with a test plugin containing additional strategies;
* 4)Checking that basic + from plugin strategies are available.
*
* @throws Exception If failed.
*/
@Test
public void testAvailableWarmUpStrategies() throws Exception {
IgniteEx n = startGrid(getConfiguration(getTestIgniteInstanceName(0)).setPluginProviders());
GridCacheProcessor cacheProc = n.context().cache();
Map<Class<? extends WarmUpConfiguration>, WarmUpStrategy> expStrats = Stream.of(new NoOpWarmUpStrategy(), new LoadAllWarmUpStrategy(log, cacheProc::cacheGroups)).collect(toMap(WarmUpStrategy::configClass, identity()));
Map<Class<? extends WarmUpConfiguration>, WarmUpStrategy> actStrats = CU.warmUpStrategies(n.context());
assertEquals(expStrats, actStrats);
stopAllGrids();
n = startGrid(0);
WarmUpTestPluginProvider pluginProvider = (WarmUpTestPluginProvider) n.configuration().getPluginProviders()[0];
pluginProvider.strats.forEach(strat -> assertNull(expStrats.put(strat.configClass(), strat)));
actStrats = CU.warmUpStrategies(n.context());
assertEquals(expStrats, actStrats);
}
Aggregations