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);
}
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);
}
}
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);
}
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());
}
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;
}
Aggregations