use of com.hazelcast.config.RingbufferConfig in project hazelcast by hazelcast.
the class DynamicConfigYamlGenerator method ringbufferYamlGenerator.
public static void ringbufferYamlGenerator(Map<String, Object> parent, Config config) {
if (config.getRingbufferConfigs().isEmpty()) {
return;
}
Map<String, Object> child = new LinkedHashMap<>();
for (RingbufferConfig subConfigAsObject : config.getRingbufferConfigs().values()) {
Map<String, Object> subConfigAsMap = new LinkedHashMap<>();
addNonNullToMap(subConfigAsMap, "capacity", subConfigAsObject.getCapacity());
addNonNullToMap(subConfigAsMap, "time-to-live-seconds", subConfigAsObject.getTimeToLiveSeconds());
addNonNullToMap(subConfigAsMap, "backup-count", subConfigAsObject.getBackupCount());
addNonNullToMap(subConfigAsMap, "async-backup-count", subConfigAsObject.getAsyncBackupCount());
addNonNullToMap(subConfigAsMap, "split-brain-protection-ref", subConfigAsObject.getSplitBrainProtectionName());
addNonNullToMap(subConfigAsMap, "in-memory-format", subConfigAsObject.getInMemoryFormat().name());
addNonNullToMap(subConfigAsMap, "ringbuffer-store", getRingbufferStoreConfigAsMap(subConfigAsObject.getRingbufferStoreConfig()));
addNonNullToMap(subConfigAsMap, "merge-policy", getMergePolicyConfigAsMap(subConfigAsObject.getMergePolicyConfig()));
child.put(subConfigAsObject.getName(), subConfigAsMap);
}
parent.put("ringbuffer", child);
}
use of com.hazelcast.config.RingbufferConfig in project hazelcast by hazelcast.
the class ConfigSearchTest method testRingbufferConfig_Static.
@Test
public void testRingbufferConfig_Static() {
TestCase<RingbufferConfig> testCase = new TestCase<RingbufferConfig>(new RingbufferConfig().setName(STATIC_NAME), new RingbufferConfig().setName(DYNAMIC_NAME), false) {
@Override
void addStaticConfig(Config config) {
config.addRingBufferConfig(this.staticConfig);
}
@Override
void addDynamicConfig(HazelcastInstance hazelcastInstance) {
hazelcastInstance.getConfig().addRingBufferConfig(this.dynamicConfig);
}
@Override
void asserts() {
RingbufferConfig dataConfig = hazelcastInstance.getConfig().findRingbufferConfig(DYNAMIC_NAME);
assertThat(dataConfig.getName(), equalTo(STATIC_NAME));
}
};
testTemplate(testCase);
}
use of com.hazelcast.config.RingbufferConfig in project hazelcast by hazelcast.
the class ClientReliableTopicStressTest method setup.
@Before
public void setup() {
logger = Logger.getLogger(getClass());
Config config = new Config();
RingbufferConfig ringbufferConfig = new RingbufferConfig("foobar");
ringbufferConfig.setCapacity(10000000);
config.addRingBufferConfig(ringbufferConfig);
ClientConfig clientConfig = new ClientConfig();
ClientReliableTopicConfig topicConfig = new ClientReliableTopicConfig("foobar");
clientConfig.addReliableTopicConfig(topicConfig);
HazelcastInstance hz = Hazelcast.newHazelcastInstance(config);
HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
topic = client.getReliableTopic(topicConfig.getName());
}
use of com.hazelcast.config.RingbufferConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method testRingbufferConfig_whenConfiguredWithRingbufferStore_byStoreImplementation.
@Test
public void testRingbufferConfig_whenConfiguredWithRingbufferStore_byStoreImplementation() {
RingbufferConfig config = getRingbufferConfig();
config.getRingbufferStoreConfig().setEnabled(true).setStoreImplementation(new SampleRingbufferStore());
driver.getConfig().addRingBufferConfig(config);
assertConfigurationsEqualOnAllMembers(config);
}
use of com.hazelcast.config.RingbufferConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method testRingbufferConfig_whenConfiguredWithRingbufferStore_byFactoryClassName.
@Test
public void testRingbufferConfig_whenConfiguredWithRingbufferStore_byFactoryClassName() {
RingbufferConfig config = getRingbufferConfig();
config.getRingbufferStoreConfig().setEnabled(true).setFactoryClassName("com.hazelcast.FactoryFoo");
driver.getConfig().addRingBufferConfig(config);
assertConfigurationsEqualOnAllMembers(config);
}
Aggregations