Search in sources :

Example 16 with PNCounterConfig

use of com.hazelcast.config.PNCounterConfig in project hazelcast by hazelcast.

the class AbstractDynamicConfigGeneratorTest method testPNCounter.

// PN COUNTER
@Test
public void testPNCounter() {
    PNCounterConfig expectedConfig = new PNCounterConfig().setName("testPNCounter").setReplicaCount(100).setSplitBrainProtectionName("splitBrainProtection");
    Config config = new Config().addPNCounterConfig(expectedConfig);
    Config decConfig = getNewConfigViaGenerator(config);
    PNCounterConfig actualConfig = decConfig.getPNCounterConfig(expectedConfig.getName());
    assertEquals(expectedConfig, actualConfig);
}
Also used : 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) PNCounterConfig(com.hazelcast.config.PNCounterConfig) Test(org.junit.Test)

Example 17 with PNCounterConfig

use of com.hazelcast.config.PNCounterConfig in project hazelcast by hazelcast.

the class PNCounterBasicIntegrationTest method setup.

@Before
public void setup() {
    final PNCounterConfig counterConfig = new PNCounterConfig().setName("default").setReplicaCount(replicaCount).setStatisticsEnabled(true);
    final Config config = new Config().setProperty(ClusterProperty.PARTITION_COUNT.getName(), "5").setCRDTReplicationConfig(new CRDTReplicationConfig().setReplicationPeriodMillis(200).setMaxConcurrentReplicationTargets(Integer.MAX_VALUE)).addPNCounterConfig(counterConfig);
    final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
    instances = factory.newInstances(config);
}
Also used : Config(com.hazelcast.config.Config) PNCounterConfig(com.hazelcast.config.PNCounterConfig) CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) TestHazelcastInstanceFactory(com.hazelcast.test.TestHazelcastInstanceFactory) PNCounterConfig(com.hazelcast.config.PNCounterConfig) Before(org.junit.Before)

Example 18 with PNCounterConfig

use of com.hazelcast.config.PNCounterConfig in project hazelcast by hazelcast.

the class DynamicConfigTest method assertConfigurationsEqualOnAllMembers.

private void assertConfigurationsEqualOnAllMembers(PNCounterConfig config) {
    String name = config.getName();
    for (HazelcastInstance instance : members) {
        PNCounterConfig registeredConfig = instance.getConfig().getPNCounterConfig(name);
        assertEquals(config, registeredConfig);
    }
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) PNCounterConfig(com.hazelcast.config.PNCounterConfig)

Aggregations

PNCounterConfig (com.hazelcast.config.PNCounterConfig)18 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)5 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)5 Config (com.hazelcast.config.Config)5 DurableExecutorConfig (com.hazelcast.config.DurableExecutorConfig)5 ExecutorConfig (com.hazelcast.config.ExecutorConfig)5 FlakeIdGeneratorConfig (com.hazelcast.config.FlakeIdGeneratorConfig)5 ListConfig (com.hazelcast.config.ListConfig)5 MapConfig (com.hazelcast.config.MapConfig)5 MultiMapConfig (com.hazelcast.config.MultiMapConfig)5 QueueConfig (com.hazelcast.config.QueueConfig)5 ReliableTopicConfig (com.hazelcast.config.ReliableTopicConfig)5 ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)5 RingbufferConfig (com.hazelcast.config.RingbufferConfig)5 ScheduledExecutorConfig (com.hazelcast.config.ScheduledExecutorConfig)5 SetConfig (com.hazelcast.config.SetConfig)3 TopicConfig (com.hazelcast.config.TopicConfig)3 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)3 QuickTest (com.hazelcast.test.annotation.QuickTest)3 Test (org.junit.Test)3