Search in sources :

Example 11 with QueueStoreConfig

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

the class AbstractDynamicConfigGeneratorTest method testQueueWithStoreFactory.

@Test
public void testQueueWithStoreFactory() {
    QueueStoreConfig queueStoreConfig = new QueueStoreConfig().setFactoryClassName("factoryClassName").setEnabled(true).setProperty("key", "value");
    testQueue(queueStoreConfig);
}
Also used : QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) Test(org.junit.Test)

Example 12 with QueueStoreConfig

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

the class AbstractDynamicConfigGeneratorTest method testQueueWithStoreClass.

// QUEUE
@Test
public void testQueueWithStoreClass() {
    QueueStoreConfig queueStoreConfig = new QueueStoreConfig().setClassName("className").setEnabled(true).setProperty("key", "value");
    testQueue(queueStoreConfig);
}
Also used : QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) Test(org.junit.Test)

Example 13 with QueueStoreConfig

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

the class AbstractDynamicConfigGeneratorTest method testQueue.

private void testQueue(QueueStoreConfig queueStoreConfig) {
    MergePolicyConfig mergePolicyConfig = new MergePolicyConfig().setPolicy(DiscardMergePolicy.class.getSimpleName()).setBatchSize(1234);
    QueueConfig expectedConfig = new QueueConfig().setName("testQueue").setPriorityComparatorClassName("com.hazelcast.collection.impl.queue.model.PriorityElementComparator").setMaxSize(10).setStatisticsEnabled(true).setBackupCount(2).setAsyncBackupCount(3).setEmptyQueueTtl(1000).setMergePolicyConfig(mergePolicyConfig).setQueueStoreConfig(queueStoreConfig).setItemListenerConfigs(singletonList(new ItemListenerConfig("java.Listener", true)));
    Config config = new Config().addQueueConfig(expectedConfig);
    Config decConfig = getNewConfigViaGenerator(config);
    QueueConfig actualConfig = decConfig.getQueueConfig("testQueue");
    assertEquals("testQueue", actualConfig.getName());
    MergePolicyConfig decMergePolicyConfig = actualConfig.getMergePolicyConfig();
    assertEquals(DiscardMergePolicy.class.getSimpleName(), decMergePolicyConfig.getPolicy());
    assertEquals(1234, decMergePolicyConfig.getBatchSize());
    ConfigCompatibilityChecker.checkQueueConfig(expectedConfig, actualConfig);
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) QueueConfig(com.hazelcast.config.QueueConfig) 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) ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) DiscardMergePolicy(com.hazelcast.spi.merge.DiscardMergePolicy)

Example 14 with QueueStoreConfig

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

the class QueueStoreTest method getBinaryQueueStoreConfig.

private QueueStoreConfig getBinaryQueueStoreConfig() {
    QueueStoreConfig queueStoreConfig = new QueueStoreConfig();
    QueueStore<Data> binaryQueueStore = new BasicQueueStore<Data>();
    queueStoreConfig.setStoreImplementation(binaryQueueStore);
    queueStoreConfig.setEnabled(true);
    queueStoreConfig.setProperty("binary", "true");
    queueStoreConfig.setProperty("memory-limit", "0");
    queueStoreConfig.setProperty("bulk-load", "100");
    return queueStoreConfig;
}
Also used : QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) Data(com.hazelcast.nio.serialization.Data)

Example 15 with QueueStoreConfig

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

the class QueueStoreConfigHolder method asQueueStoreConfig.

public QueueStoreConfig asQueueStoreConfig(SerializationService serializationService) {
    QueueStoreConfig config = new QueueStoreConfig();
    if (!StringUtil.isNullOrEmptyAfterTrim(className)) {
        config.setClassName(className);
    }
    config.setEnabled(enabled);
    if (!StringUtil.isNullOrEmptyAfterTrim(factoryClassName)) {
        config.setFactoryClassName(factoryClassName);
    }
    config.setProperties(PropertiesUtil.fromMap(properties));
    QueueStore storeImplementation = serializationService.toObject(implementation);
    if (storeImplementation != null) {
        config.setStoreImplementation(storeImplementation);
    }
    QueueStoreFactory storeFactoryImplementation = serializationService.toObject(factoryImplementation);
    if (storeFactoryImplementation != null) {
        config.setFactoryImplementation(storeFactoryImplementation);
    }
    return config;
}
Also used : QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) QueueStore(com.hazelcast.collection.QueueStore) QueueStoreFactory(com.hazelcast.collection.QueueStoreFactory)

Aggregations

QueueStoreConfig (com.hazelcast.config.QueueStoreConfig)24 Test (org.junit.Test)13 Config (com.hazelcast.config.Config)11 QuickTest (com.hazelcast.test.annotation.QuickTest)9 VersionedObject (com.hazelcast.collection.impl.queue.model.VersionedObject)8 HazelcastInstance (com.hazelcast.core.HazelcastInstance)8 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)8 MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)7 QueueConfig (com.hazelcast.config.QueueConfig)6 ItemListenerConfig (com.hazelcast.config.ItemListenerConfig)4 AttributeConfig (com.hazelcast.config.AttributeConfig)2 AwsConfig (com.hazelcast.config.AwsConfig)2 CachePartitionLostListenerConfig (com.hazelcast.config.CachePartitionLostListenerConfig)2 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)2 CacheSimpleEntryListenerConfig (com.hazelcast.config.CacheSimpleEntryListenerConfig)2 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)2 DataPersistenceConfig (com.hazelcast.config.DataPersistenceConfig)2 DiscoveryConfig (com.hazelcast.config.DiscoveryConfig)2 DiscoveryStrategyConfig (com.hazelcast.config.DiscoveryStrategyConfig)2 DiskTierConfig (com.hazelcast.config.DiskTierConfig)2