Search in sources :

Example 61 with RingbufferConfig

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

the class AddAllOperationTest method setup.

@Before
public void setup() {
    RingbufferConfig rbConfig = new RingbufferConfig("foo").setCapacity(10).setTimeToLiveSeconds(10);
    Config config = new Config().addRingBufferConfig(rbConfig);
    HazelcastInstance hz = createHazelcastInstance(config);
    nodeEngine = getNodeEngineImpl(hz);
    serializationService = getSerializationService(hz);
    ringbuffer = hz.getRingbuffer(rbConfig.getName());
    ringbufferService = nodeEngine.getService(RingbufferService.SERVICE_NAME);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Config(com.hazelcast.config.Config) RingbufferConfig(com.hazelcast.config.RingbufferConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) Before(org.junit.Before)

Example 62 with RingbufferConfig

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

the class GenericOperationTest method setup.

@Before
public void setup() {
    RingbufferConfig rbConfig = new RingbufferConfig("foo").setCapacity(CAPACITY).setTimeToLiveSeconds(10);
    Config config = new Config().addRingBufferConfig(rbConfig);
    HazelcastInstance hz = createHazelcastInstance(config);
    nodeEngine = getNodeEngineImpl(hz);
    serializationService = nodeEngine.getSerializationService();
    final String name = rbConfig.getName();
    ringbuffer = hz.getRingbuffer(name);
    ringbufferService = getNodeEngineImpl(hz).getService(RingbufferService.SERVICE_NAME);
    ringbufferContainer = ringbufferService.getOrCreateContainer(ringbufferService.getRingbufferPartitionId(name), RingbufferService.getRingbufferNamespace(name), rbConfig);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Config(com.hazelcast.config.Config) RingbufferConfig(com.hazelcast.config.RingbufferConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) Before(org.junit.Before)

Example 63 with RingbufferConfig

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

the class ReadOneOperationTest method setup.

@Before
public void setup() {
    RingbufferConfig rbConfig = new RingbufferConfig("foo").setCapacity(10).setTimeToLiveSeconds(10);
    Config config = new Config().addRingBufferConfig(rbConfig);
    hz = createHazelcastInstance(config);
    nodeEngine = getNodeEngineImpl(hz);
    serializationService = getSerializationService(hz);
    final String name = rbConfig.getName();
    ringbuffer = hz.getRingbuffer(name);
    ringbufferService = getNodeEngineImpl(hz).getService(RingbufferService.SERVICE_NAME);
    ringbufferContainer = ringbufferService.getOrCreateContainer(ringbufferService.getRingbufferPartitionId(name), RingbufferService.getRingbufferNamespace(name), rbConfig);
}
Also used : RingbufferConfig(com.hazelcast.config.RingbufferConfig) Config(com.hazelcast.config.Config) RingbufferConfig(com.hazelcast.config.RingbufferConfig) Before(org.junit.Before)

Example 64 with RingbufferConfig

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

the class ReadManyOperationTest method setup.

@Before
public void setup() {
    RingbufferConfig rbConfig = new RingbufferConfig("foo").setCapacity(10).setTimeToLiveSeconds(10);
    Config config = new Config().addRingBufferConfig(rbConfig);
    hz = createHazelcastInstance(config);
    nodeEngine = getNodeEngineImpl(hz);
    serializationService = nodeEngine.getSerializationService();
    final String name = rbConfig.getName();
    ringbuffer = hz.getRingbuffer(name);
    ringbufferService = getNodeEngineImpl(hz).getService(RingbufferService.SERVICE_NAME);
    ringbufferContainer = ringbufferService.getOrCreateContainer(ringbufferService.getRingbufferPartitionId(name), RingbufferService.getRingbufferNamespace(name), rbConfig);
}
Also used : RingbufferConfig(com.hazelcast.config.RingbufferConfig) Config(com.hazelcast.config.Config) RingbufferConfig(com.hazelcast.config.RingbufferConfig) Before(org.junit.Before)

Example 65 with RingbufferConfig

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

the class RingbufferTTLTest method setup.

public void setup(RingbufferConfig ringbufferConfig) {
    Config config = new Config();
    config.addRingBufferConfig(ringbufferConfig);
    hz = createHazelcastInstance(config);
    final String name = ringbufferConfig.getName();
    ringbuffer = hz.getRingbuffer(name);
    RingbufferService ringbufferService = getNodeEngineImpl(hz).getService(RingbufferService.SERVICE_NAME);
    ringbufferContainer = ringbufferService.getOrCreateContainer(ringbufferService.getRingbufferPartitionId(name), RingbufferService.getRingbufferNamespace(name), ringbufferConfig);
    arrayRingbuffer = (ArrayRingbuffer) ringbufferContainer.getRingbuffer();
}
Also used : 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