use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class AbstractDynamicConfigGeneratorTest method testScheduledExecutor.
// SCHEDULED EXECUTOR
@Test
public void testScheduledExecutor() {
Config cfg = new Config();
ScheduledExecutorConfig scheduledExecutorConfig = new ScheduledExecutorConfig().setCapacity(1).setCapacityPolicy(ScheduledExecutorConfig.CapacityPolicy.PER_PARTITION).setDurability(2).setName("Existing").setPoolSize(3).setSplitBrainProtectionName("splitBrainProtection").setMergePolicyConfig(new MergePolicyConfig("JediPolicy", 23)).setStatisticsEnabled(false);
cfg.addScheduledExecutorConfig(scheduledExecutorConfig);
ScheduledExecutorConfig defaultScheduledExecConfig = new ScheduledExecutorConfig();
cfg.addScheduledExecutorConfig(defaultScheduledExecConfig);
ScheduledExecutorConfig existing = getNewConfigViaGenerator(cfg).getScheduledExecutorConfig("Existing");
assertEquals(scheduledExecutorConfig, existing);
ScheduledExecutorConfig fallbacksToDefault = getNewConfigViaGenerator(cfg).getScheduledExecutorConfig("NotExisting/Default");
assertEquals(defaultScheduledExecConfig.getMergePolicyConfig(), fallbacksToDefault.getMergePolicyConfig());
assertEquals(defaultScheduledExecConfig.getCapacity(), fallbacksToDefault.getCapacity());
assertEquals(defaultScheduledExecConfig.getCapacityPolicy(), fallbacksToDefault.getCapacityPolicy());
assertEquals(defaultScheduledExecConfig.getPoolSize(), fallbacksToDefault.getPoolSize());
assertEquals(defaultScheduledExecConfig.getDurability(), fallbacksToDefault.getDurability());
assertEquals(defaultScheduledExecConfig.isStatisticsEnabled(), fallbacksToDefault.isStatisticsEnabled());
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class SetSplitBrainTest method config.
@Override
protected Config config() {
MergePolicyConfig mergePolicyConfig = new MergePolicyConfig().setPolicy(mergePolicyClass.getName()).setBatchSize(10);
Config config = super.config();
config.getSetConfig(setNameA).setBackupCount(1).setAsyncBackupCount(0).setMergePolicyConfig(mergePolicyConfig);
config.getSetConfig(setNameB).setBackupCount(1).setAsyncBackupCount(0).setMergePolicyConfig(mergePolicyConfig);
return config;
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class AbstractMergePolicyValidatorIntegrationTest method getHazelcastInstance.
HazelcastInstance getHazelcastInstance(String name, MergePolicyConfig mergePolicyConfig) {
Config config = smallInstanceConfig();
addConfig(config, name, mergePolicyConfig);
return factory.newHazelcastInstance(config);
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method testCardinalityEstimatorConfig.
@Test
public void testCardinalityEstimatorConfig() {
CardinalityEstimatorConfig config = new CardinalityEstimatorConfig(name, 4, 2).setMergePolicyConfig(new MergePolicyConfig("com.hazelcast.spi.merge.DiscardMergePolicy", 20));
driver.getConfig().addCardinalityEstimatorConfig(config);
assertConfigurationsEqualOnAllMembers(config);
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class ScheduledExecutorSplitBrainTest method config.
@Override
protected Config config() {
MergePolicyConfig mergePolicyConfig = new MergePolicyConfig().setPolicy(mergePolicyClass.getName()).setBatchSize(10);
Config config = super.config();
config.getScheduledExecutorConfig(scheduledExecutorName).setDurability(1).setCapacityPolicy(ScheduledExecutorConfig.CapacityPolicy.PER_PARTITION).setMergePolicyConfig(mergePolicyConfig);
return config;
}
Aggregations