Search in sources :

Example 71 with RingbufferConfig

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

the class ReliableTopicBlockTest method setup.

@Before
public void setup() {
    Config config = smallInstanceConfig();
    config.addRingBufferConfig(new RingbufferConfig("blockingReliableTopic*").setCapacity(10).setTimeToLiveSeconds(60));
    config.addReliableTopicConfig(new ReliableTopicConfig("blockingReliableTopic*").setReadBatchSize(10).setTopicOverloadPolicy(TopicOverloadPolicy.BLOCK));
    HazelcastInstance[] instances = createHazelcastInstanceFactory(1).newInstances(config);
    local = instances[0];
    HazelcastInstance target = instances[instances.length - 1];
    String name = randomNameOwnedBy(target, "reliableTopic");
    topic = local.getReliableTopic(name);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) Config(com.hazelcast.config.Config) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) Before(org.junit.Before)

Example 72 with RingbufferConfig

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

the class ErrorHandlingTest method setup.

@Before
public void setup() {
    Config config = new Config();
    config.addRingBufferConfig(new RingbufferConfig("foo").setCapacity(100).setTimeToLiveSeconds(0));
    HazelcastInstance hz = createHazelcastInstance(config);
    topic = (ReliableTopicProxy<String>) hz.<String>getReliableTopic("foo");
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Config(com.hazelcast.config.Config) RingbufferConfig(com.hazelcast.config.RingbufferConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) Before(org.junit.Before)

Example 73 with RingbufferConfig

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

the class ReliableTopicAbstractTest method setup.

@Before
public void setup() {
    ReliableTopicConfig topicConfig = new ReliableTopicConfig("reliableTopic*");
    RingbufferConfig ringbufferConfig = new RingbufferConfig(topicConfig.getName());
    ringbufferConfig.setCapacity(CAPACITY);
    Config config = new Config();
    config.addReliableTopicConfig(topicConfig);
    config.addRingBufferConfig(ringbufferConfig);
    instances = newInstances(config);
    local = instances[0];
    HazelcastInstance target = instances[instances.length - 1];
    String name = randomNameOwnedBy(target, "reliableTopic");
    topic = (ReliableTopicProxy<String>) local.<String>getReliableTopic(name);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) Config(com.hazelcast.config.Config) RingbufferConfig(com.hazelcast.config.RingbufferConfig) Before(org.junit.Before)

Example 74 with RingbufferConfig

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

the class RingbufferAddAllReadManyStressTest method whenNoTTL.

@Test(timeout = MINUTE * 10)
public void whenNoTTL() {
    RingbufferConfig ringbufferConfig = new RingbufferConfig("rb").setCapacity(20 * 1000 * 1000).setInMemoryFormat(InMemoryFormat.OBJECT).setTimeToLiveSeconds(0);
    test(ringbufferConfig);
}
Also used : RingbufferConfig(com.hazelcast.config.RingbufferConfig) NightlyTest(com.hazelcast.test.annotation.NightlyTest) Test(org.junit.Test)

Example 75 with RingbufferConfig

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

the class RingbufferAddAllReadManyStressTest method whenTTLEnabled.

@Test(timeout = MINUTE * 10)
public void whenTTLEnabled() {
    RingbufferConfig ringbufferConfig = new RingbufferConfig("rb").setCapacity(200 * 1000).setTimeToLiveSeconds(2);
    test(ringbufferConfig);
}
Also used : RingbufferConfig(com.hazelcast.config.RingbufferConfig) NightlyTest(com.hazelcast.test.annotation.NightlyTest) Test(org.junit.Test)

Aggregations

RingbufferConfig (com.hazelcast.config.RingbufferConfig)91 Test (org.junit.Test)43 Config (com.hazelcast.config.Config)35 QuickTest (com.hazelcast.test.annotation.QuickTest)26 HazelcastInstance (com.hazelcast.core.HazelcastInstance)22 Before (org.junit.Before)21 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)14 NightlyTest (com.hazelcast.test.annotation.NightlyTest)12 ReliableTopicConfig (com.hazelcast.config.ReliableTopicConfig)11 RingbufferStoreConfig (com.hazelcast.config.RingbufferStoreConfig)9 Data (com.hazelcast.internal.serialization.Data)7 TopicConfig (com.hazelcast.config.TopicConfig)6 ClientConfig (com.hazelcast.client.config.ClientConfig)5 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)5 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)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