Search in sources :

Example 56 with MergePolicyConfig

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());
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) ListConfig(com.hazelcast.config.ListConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) AwsConfig(com.hazelcast.config.AwsConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) MapConfig(com.hazelcast.config.MapConfig) PredicateConfig(com.hazelcast.config.PredicateConfig) MultiMapConfig(com.hazelcast.config.MultiMapConfig) PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) ExecutorConfig(com.hazelcast.config.ExecutorConfig) DiscoveryStrategyConfig(com.hazelcast.config.DiscoveryStrategyConfig) DiskTierConfig(com.hazelcast.config.DiskTierConfig) IndexConfig(com.hazelcast.config.IndexConfig) NearCacheConfig(com.hazelcast.config.NearCacheConfig) MapStoreConfig(com.hazelcast.config.MapStoreConfig) QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) CacheSimpleEntryListenerConfig(com.hazelcast.config.CacheSimpleEntryListenerConfig) RingbufferStoreConfig(com.hazelcast.config.RingbufferStoreConfig) WanConsumerConfig(com.hazelcast.config.WanConsumerConfig) AttributeConfig(com.hazelcast.config.AttributeConfig) SetConfig(com.hazelcast.config.SetConfig) PNCounterConfig(com.hazelcast.config.PNCounterConfig) QueueConfig(com.hazelcast.config.QueueConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) CardinalityEstimatorConfig(com.hazelcast.config.CardinalityEstimatorConfig) WanCustomPublisherConfig(com.hazelcast.config.WanCustomPublisherConfig) WanBatchPublisherConfig(com.hazelcast.config.WanBatchPublisherConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) EvictionConfig(com.hazelcast.config.EvictionConfig) TieredStoreConfig(com.hazelcast.config.TieredStoreConfig) QueryCacheConfig(com.hazelcast.config.QueryCacheConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig) TopicConfig(com.hazelcast.config.TopicConfig) Config(com.hazelcast.config.Config) DiscoveryConfig(com.hazelcast.config.DiscoveryConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) DataPersistenceConfig(com.hazelcast.config.DataPersistenceConfig) DurableExecutorConfig(com.hazelcast.config.DurableExecutorConfig) MapPartitionLostListenerConfig(com.hazelcast.config.MapPartitionLostListenerConfig) WanReplicationConfig(com.hazelcast.config.WanReplicationConfig) FlakeIdGeneratorConfig(com.hazelcast.config.FlakeIdGeneratorConfig) MerkleTreeConfig(com.hazelcast.config.MerkleTreeConfig) MemoryTierConfig(com.hazelcast.config.MemoryTierConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig) Test(org.junit.Test)

Example 57 with MergePolicyConfig

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;
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) Config(com.hazelcast.config.Config) MergePolicyConfig(com.hazelcast.config.MergePolicyConfig)

Example 58 with MergePolicyConfig

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);
}
Also used : Config(com.hazelcast.config.Config) MergePolicyConfig(com.hazelcast.config.MergePolicyConfig)

Example 59 with MergePolicyConfig

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);
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) CardinalityEstimatorConfig(com.hazelcast.config.CardinalityEstimatorConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 60 with MergePolicyConfig

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;
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig) Config(com.hazelcast.config.Config) MergePolicyConfig(com.hazelcast.config.MergePolicyConfig)

Aggregations

MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)65 Config (com.hazelcast.config.Config)21 Test (org.junit.Test)20 ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)18 MapConfig (com.hazelcast.config.MapConfig)17 MultiMapConfig (com.hazelcast.config.MultiMapConfig)17 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)16 ItemListenerConfig (com.hazelcast.config.ItemListenerConfig)16 QueueStoreConfig (com.hazelcast.config.QueueStoreConfig)15 RingbufferStoreConfig (com.hazelcast.config.RingbufferStoreConfig)15 ScheduledExecutorConfig (com.hazelcast.config.ScheduledExecutorConfig)15 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)13 EvictionConfig (com.hazelcast.config.EvictionConfig)13 ListenerConfig (com.hazelcast.config.ListenerConfig)13 QueueConfig (com.hazelcast.config.QueueConfig)13 RingbufferConfig (com.hazelcast.config.RingbufferConfig)13 EventJournalConfig (com.hazelcast.config.EventJournalConfig)12 ListConfig (com.hazelcast.config.ListConfig)12 MapPartitionLostListenerConfig (com.hazelcast.config.MapPartitionLostListenerConfig)12 SetConfig (com.hazelcast.config.SetConfig)12