Search in sources :

Example 86 with RingbufferConfig

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);
}
Also used : RingbufferConfig(com.hazelcast.config.RingbufferConfig) NightlyTest(com.hazelcast.test.annotation.NightlyTest) Test(org.junit.Test)

Example 87 with 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);
}
Also used : RingbufferConfig(com.hazelcast.config.RingbufferConfig) NightlyTest(com.hazelcast.test.annotation.NightlyTest) Test(org.junit.Test)

Example 88 with 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);
}
Also used : DynamicConfigurationAwareConfig(com.hazelcast.internal.dynamicconfig.DynamicConfigurationAwareConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig)

Example 89 with 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;
}
Also used : RingbufferConfig(com.hazelcast.config.RingbufferConfig) Config(com.hazelcast.config.Config) RingbufferConfig(com.hazelcast.config.RingbufferConfig) HazelcastInstanceNotActiveException(com.hazelcast.core.HazelcastInstanceNotActiveException) HazelcastClientNotActiveException(com.hazelcast.client.HazelcastClientNotActiveException) DistributedObjectDestroyedException(com.hazelcast.spi.exception.DistributedObjectDestroyedException) StaleSequenceException(com.hazelcast.ringbuffer.StaleSequenceException) OperationTimeoutException(com.hazelcast.core.OperationTimeoutException)

Example 90 with RingbufferConfig

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);
}
Also used : RingbufferConfig(com.hazelcast.config.RingbufferConfig) RingbufferService(com.hazelcast.ringbuffer.impl.RingbufferService) EventJournalConfig(com.hazelcast.config.EventJournalConfig)

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