Search in sources :

Example 11 with EventJournalConfig

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

the class AbstractEventJournalExpiringTest method getConfig.

@Override
protected Config getConfig() {
    int defaultPartitionCount = Integer.parseInt(ClusterProperty.PARTITION_COUNT.getDefaultValue());
    Config config = smallInstanceConfig();
    EventJournalConfig eventJournalConfig = new EventJournalConfig().setEnabled(true).setTimeToLiveSeconds(1).setCapacity(500 * defaultPartitionCount);
    config.getMapConfig("default").setEventJournalConfig(eventJournalConfig);
    config.getCacheConfig("default").setEventJournalConfig(eventJournalConfig);
    return config;
}
Also used : Config(com.hazelcast.config.Config) EventJournalConfig(com.hazelcast.config.EventJournalConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig)

Example 12 with EventJournalConfig

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

the class OrderedProcessingMultipleMemberTest method setupClass.

@BeforeClass
public static void setupClass() {
    Config config = smallInstanceConfig();
    EventJournalConfig eventJournalConfig = config.getMapConfig(JOURNALED_MAP_PREFIX + '*').getEventJournalConfig();
    eventJournalConfig.setEnabled(true);
    // 30000/271 ~= 111 item per partition
    eventJournalConfig.setCapacity(30000);
    instances = new JetInstance[INSTANCE_COUNT];
    for (int i = 0; i < INSTANCE_COUNT; i++) {
        instances[i] = (JetInstance) Hazelcast.newHazelcastInstance(config).getJet();
    }
}
Also used : EventJournalConfig(com.hazelcast.config.EventJournalConfig) Config(com.hazelcast.config.Config) EventJournalConfig(com.hazelcast.config.EventJournalConfig) BeforeClass(org.junit.BeforeClass)

Example 13 with EventJournalConfig

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

the class AdvancedMapJournalTest method getConfig.

@Override
protected Config getConfig() {
    Config config = super.getConfig().setProperty(ClusterProperty.PARTITION_COUNT.getName(), String.valueOf(PARTITION_COUNT));
    config.getMapConfig("default").setEventJournalConfig(new EventJournalConfig().setEnabled(true));
    return config;
}
Also used : Config(com.hazelcast.config.Config) EventJournalConfig(com.hazelcast.config.EventJournalConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig)

Example 14 with EventJournalConfig

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

the class AbstractDynamicConfigGeneratorTest method testCacheAttributes.

// CACHE
@Test
public void testCacheAttributes() {
    CacheSimpleConfig expectedConfig = new CacheSimpleConfig().setName("testCache").setEvictionConfig(evictionConfig()).setInMemoryFormat(InMemoryFormat.OBJECT).setBackupCount(2).setAsyncBackupCount(3).setCacheLoader("cacheLoader").setCacheWriter("cacheWriter").setExpiryPolicyFactoryConfig(new CacheSimpleConfig.ExpiryPolicyFactoryConfig("expiryPolicyFactory")).setManagementEnabled(true).setStatisticsEnabled(true).setKeyType("keyType").setValueType("valueType").setReadThrough(true).setDataPersistenceConfig(dataPersistenceConfig()).setEventJournalConfig(eventJournalConfig()).setCacheEntryListeners(singletonList(cacheSimpleEntryListenerConfig())).setWriteThrough(true).setPartitionLostListenerConfigs(singletonList(new CachePartitionLostListenerConfig("partitionLostListener"))).setSplitBrainProtectionName("testSplitBrainProtection");
    expectedConfig.getMergePolicyConfig().setPolicy("HigherHitsMergePolicy").setBatchSize(99);
    expectedConfig.setDisablePerEntryInvalidationEvents(true);
    expectedConfig.setWanReplicationRef(wanReplicationRef());
    Config config = new Config().addCacheConfig(expectedConfig);
    Config decConfig = getNewConfigViaGenerator(config);
    CacheSimpleConfig actualConfig = decConfig.getCacheConfig("testCache");
    assertEquals(expectedConfig, actualConfig);
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) 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) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) Test(org.junit.Test)

Example 15 with EventJournalConfig

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

the class AbstractDynamicConfigGeneratorTest method testMap.

// UTILITY - TESTS
private void testMap(MapStoreConfig mapStoreConfig) {
    AttributeConfig attrConfig = new AttributeConfig().setName("power").setExtractorClassName("com.car.PowerExtractor");
    EvictionConfig evictionConfig1 = new EvictionConfig().setSize(10).setMaxSizePolicy(MaxSizePolicy.FREE_NATIVE_MEMORY_SIZE);
    IndexConfig indexConfig = new IndexConfig().addAttribute("attribute").setType(IndexType.SORTED);
    EntryListenerConfig listenerConfig = new EntryListenerConfig("com.hazelcast.entrylistener", false, false);
    EvictionConfig evictionConfig2 = new EvictionConfig().setMaxSizePolicy(MaxSizePolicy.FREE_NATIVE_MEMORY_SIZE).setSize(100).setComparatorClassName("comparatorClassName").setEvictionPolicy(EvictionPolicy.LRU);
    PredicateConfig predicateConfig1 = new PredicateConfig();
    predicateConfig1.setClassName("className");
    PredicateConfig predicateConfig2 = new PredicateConfig();
    predicateConfig2.setSql("sqlQuery");
    QueryCacheConfig queryCacheConfig1 = new QueryCacheConfig().setName("queryCache1").setPredicateConfig(predicateConfig1).addEntryListenerConfig(listenerConfig).setBatchSize(230).setDelaySeconds(20).setPopulate(false).setBufferSize(8).setInMemoryFormat(InMemoryFormat.BINARY).setEvictionConfig(evictionConfig2).setIncludeValue(false).setCoalesce(false).addIndexConfig(indexConfig);
    QueryCacheConfig queryCacheConfig2 = new QueryCacheConfig().setName("queryCache2").setPredicateConfig(predicateConfig2).addEntryListenerConfig(listenerConfig).setBatchSize(500).setDelaySeconds(10).setPopulate(true).setBufferSize(10).setInMemoryFormat(InMemoryFormat.OBJECT).setEvictionConfig(evictionConfig2).setIncludeValue(true).setCoalesce(true).addIndexConfig(indexConfig);
    MapConfig expectedConfig = newMapConfig().setName("carMap").setEvictionConfig(evictionConfig1).setInMemoryFormat(InMemoryFormat.NATIVE).setMetadataPolicy(MetadataPolicy.CREATE_ON_UPDATE).setMaxIdleSeconds(100).setTimeToLiveSeconds(1000).setCacheDeserializedValues(CacheDeserializedValues.ALWAYS).setStatisticsEnabled(true).setPerEntryStatsEnabled(false).setReadBackupData(true).setBackupCount(2).setAsyncBackupCount(3).setMapStoreConfig(mapStoreConfig).setWanReplicationRef(wanReplicationRef()).setPartitioningStrategyConfig(new PartitioningStrategyConfig("partitionStrategyClass")).setMerkleTreeConfig(merkleTreeConfig()).setEventJournalConfig(eventJournalConfig()).setDataPersistenceConfig(dataPersistenceConfig()).addEntryListenerConfig(listenerConfig).setIndexConfigs(singletonList(indexConfig)).addAttributeConfig(attrConfig).setPartitionLostListenerConfigs(singletonList(new MapPartitionLostListenerConfig("partitionLostListener")));
    expectedConfig.setQueryCacheConfigs(asList(queryCacheConfig1, queryCacheConfig2));
    Config config = new Config().addMapConfig(expectedConfig);
    Config decConfig = getNewConfigViaGenerator(config);
    MapConfig actualConfig = decConfig.getMapConfig("carMap");
    AttributeConfig decAttrConfig = actualConfig.getAttributeConfigs().get(0);
    assertEquals(attrConfig.getName(), decAttrConfig.getName());
    assertEquals(attrConfig.getExtractorClassName(), decAttrConfig.getExtractorClassName());
    ConfigCompatibilityChecker.checkMapConfig(expectedConfig, actualConfig);
}
Also used : PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) IndexConfig(com.hazelcast.config.IndexConfig) QueryCacheConfig(com.hazelcast.config.QueryCacheConfig) MapPartitionLostListenerConfig(com.hazelcast.config.MapPartitionLostListenerConfig) EvictionConfig(com.hazelcast.config.EvictionConfig) PredicateConfig(com.hazelcast.config.PredicateConfig) 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) MapConfig(com.hazelcast.config.MapConfig) MultiMapConfig(com.hazelcast.config.MultiMapConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) CacheSimpleEntryListenerConfig(com.hazelcast.config.CacheSimpleEntryListenerConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) AttributeConfig(com.hazelcast.config.AttributeConfig)

Aggregations

EventJournalConfig (com.hazelcast.config.EventJournalConfig)32 Config (com.hazelcast.config.Config)13 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)10 JetConfig (com.hazelcast.jet.config.JetConfig)9 Before (org.junit.Before)9 MapConfig (com.hazelcast.config.MapConfig)6 MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)6 AttributeConfig (com.hazelcast.config.AttributeConfig)5 IndexConfig (com.hazelcast.config.IndexConfig)5 MapStoreConfig (com.hazelcast.config.MapStoreConfig)5 MultiMapConfig (com.hazelcast.config.MultiMapConfig)5 NearCacheConfig (com.hazelcast.config.NearCacheConfig)5 AwsConfig (com.hazelcast.config.AwsConfig)4 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)4 DiscoveryConfig (com.hazelcast.config.DiscoveryConfig)4 DiscoveryStrategyConfig (com.hazelcast.config.DiscoveryStrategyConfig)4 DiskTierConfig (com.hazelcast.config.DiskTierConfig)4 DurableExecutorConfig (com.hazelcast.config.DurableExecutorConfig)4 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)4 EvictionConfig (com.hazelcast.config.EvictionConfig)4