Search in sources :

Example 56 with RingbufferConfig

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

the class DynamicConfigTest method testRingbufferConfig.

@Test
public void testRingbufferConfig() {
    RingbufferConfig config = getRingbufferConfig();
    driver.getConfig().addRingBufferConfig(config);
    assertConfigurationsEqualOnAllMembers(config);
}
Also used : RingbufferConfig(com.hazelcast.config.RingbufferConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 57 with RingbufferConfig

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

the class DynamicConfigTest method assertConfigurationsEqualOnAllMembers.

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

Example 58 with RingbufferConfig

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

the class RingbufferDestroyTest method setUp.

@Before
public void setUp() throws Exception {
    Config config = smallInstanceConfig();
    config.addRingBufferConfig(new RingbufferConfig(NAME).setCapacity(10));
    instances = createHazelcastInstances(config, 2);
    ringbuffer = instances[0].getRingbuffer(NAME);
}
Also used : Config(com.hazelcast.config.Config) RingbufferConfig(com.hazelcast.config.RingbufferConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) Before(org.junit.Before)

Example 59 with RingbufferConfig

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

the class RingbufferMigrationTest method test.

@Test
public void test() throws Exception {
    final String ringbufferName = "ringbuffer";
    final Config config = new Config().addRingBufferConfig(new RingbufferConfig(ringbufferName).setTimeToLiveSeconds(0));
    config.setProperty(ClusterProperty.PARTITION_COUNT.getName(), BOUNCING_TEST_PARTITION_COUNT);
    HazelcastInstance hz1 = instanceFactory.newHazelcastInstance(config);
    for (int k = 0; k < 10 * CAPACITY; k++) {
        hz1.getRingbuffer(ringbufferName).add(k);
    }
    long oldTailSeq = hz1.getRingbuffer(ringbufferName).tailSequence();
    long oldHeadSeq = hz1.getRingbuffer(ringbufferName).headSequence();
    HazelcastInstance hz2 = instanceFactory.newHazelcastInstance(config);
    HazelcastInstance hz3 = instanceFactory.newHazelcastInstance(config);
    assertClusterSizeEventually(3, hz2);
    waitAllForSafeState(hz1, hz2, hz3);
    hz1.shutdown();
    assertClusterSizeEventually(2, hz2);
    waitAllForSafeState(hz2, hz3);
    assertEquals(oldTailSeq, hz2.getRingbuffer(ringbufferName).tailSequence());
    assertEquals(oldHeadSeq, hz2.getRingbuffer(ringbufferName).headSequence());
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Config(com.hazelcast.config.Config) RingbufferConfig(com.hazelcast.config.RingbufferConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 60 with RingbufferConfig

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

the class RingbufferStoreFailureConsistencyTest method getConfig.

private static Config getConfig(String ringbufferName, int capacity, RingbufferStoreConfig ringbufferStoreConfig) {
    Config config = new Config();
    RingbufferConfig rbConfig = config.getRingbufferConfig(ringbufferName).setInMemoryFormat(OBJECT).setBackupCount(1).setCapacity(capacity);
    rbConfig.setRingbufferStoreConfig(ringbufferStoreConfig);
    return config;
}
Also used : RingbufferStoreConfig(com.hazelcast.config.RingbufferStoreConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) Config(com.hazelcast.config.Config) RingbufferConfig(com.hazelcast.config.RingbufferConfig)

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