use of com.hazelcast.config.RingbufferConfig in project hazelcast by hazelcast.
the class RingbufferAddReadOneStressTest method whenShortTTLAndBigBuffer.
@Test(timeout = 15 * 60 * 1000)
public void whenShortTTLAndBigBuffer() throws Exception {
RingbufferConfig ringbufferConfig = new RingbufferConfig("foo").setCapacity(10 * 1000 * 1000).setTimeToLiveSeconds(2);
test(ringbufferConfig);
}
use of com.hazelcast.config.RingbufferConfig in project hazelcast by hazelcast.
the class RingbufferAddReadOneStressTest method whenLongTTLAndSmallBuffer.
@Test
public void whenLongTTLAndSmallBuffer() throws Exception {
RingbufferConfig ringbufferConfig = new RingbufferConfig("foo").setCapacity(3 * 1000).setTimeToLiveSeconds(30);
test(ringbufferConfig);
}
use of com.hazelcast.config.RingbufferConfig in project hazelcast by hazelcast.
the class AddRingbufferConfigMessageTask method checkStaticConfigDoesNotExist.
@Override
protected boolean checkStaticConfigDoesNotExist(IdentifiedDataSerializable config) {
DynamicConfigurationAwareConfig nodeConfig = (DynamicConfigurationAwareConfig) nodeEngine.getConfig();
RingbufferConfig ringbufferConfig = (RingbufferConfig) config;
return nodeConfig.checkStaticConfigDoesNotExist(nodeConfig.getStaticConfig().getRingbufferConfigs(), ringbufferConfig.getName(), ringbufferConfig);
}
use of com.hazelcast.config.RingbufferConfig in project hazelcast by hazelcast.
the class ObservableImpl method configureCapacity.
@Override
public Observable<T> configureCapacity(int capacity) {
String ringbufferName = ringbufferName(name);
if (ringbufferExists(ringbufferName)) {
throw new IllegalStateException("Underlying buffer for observable '" + name + "' is already created.");
}
Config config = hzInstance.getConfig();
try {
config.addRingBufferConfig(new RingbufferConfig(ringbufferName).setCapacity(capacity));
} catch (Exception e) {
throw new RuntimeException("Failed configuring capacity: " + e, e);
}
return this;
}
use of com.hazelcast.config.RingbufferConfig in project hazelcast by hazelcast.
the class RingbufferMapEventJournalImpl method getRingbufferOrNull.
private RingbufferContainer<InternalEventJournalMapEvent, Object> getRingbufferOrNull(ObjectNamespace namespace, int partitionId) {
RingbufferService service = getRingbufferService();
RingbufferConfig ringbufferConfig;
RingbufferContainer<InternalEventJournalMapEvent, Object> container = service.getContainerOrNull(partitionId, namespace);
if (container != null) {
return container;
}
EventJournalConfig config = getEventJournalConfig(namespace);
if (config == null || !config.isEnabled()) {
return null;
}
ringbufferConfig = toRingbufferConfig(config, namespace);
return service.getOrCreateContainer(partitionId, namespace, ringbufferConfig);
}
Aggregations