use of com.hazelcast.ringbuffer.impl.RingbufferService in project hazelcast by hazelcast.
the class ReplicationOperation method run.
@Override
public void run() {
RingbufferService service = getService();
for (Map.Entry<String, RingbufferContainer> entry : migrationData.entrySet()) {
String name = entry.getKey();
RingbufferContainer ringbuffer = entry.getValue();
service.addRingbuffer(name, ringbuffer);
}
}
use of com.hazelcast.ringbuffer.impl.RingbufferService in project hazelcast by hazelcast.
the class ServiceManagerImpl method registerDefaultServices.
private void registerDefaultServices(ServicesConfig servicesConfig) {
if (!servicesConfig.isEnableDefaults()) {
return;
}
logger.finest("Registering default services...");
registerService(MapService.SERVICE_NAME, createService(MapService.class));
registerService(LockService.SERVICE_NAME, new LockServiceImpl(nodeEngine));
registerService(QueueService.SERVICE_NAME, new QueueService(nodeEngine));
registerService(TopicService.SERVICE_NAME, new TopicService());
registerService(ReliableTopicService.SERVICE_NAME, new ReliableTopicService(nodeEngine));
registerService(MultiMapService.SERVICE_NAME, new MultiMapService(nodeEngine));
registerService(ListService.SERVICE_NAME, new ListService(nodeEngine));
registerService(SetService.SERVICE_NAME, new SetService(nodeEngine));
registerService(DistributedExecutorService.SERVICE_NAME, new DistributedExecutorService());
registerService(DistributedDurableExecutorService.SERVICE_NAME, new DistributedDurableExecutorService(nodeEngine));
registerService(AtomicLongService.SERVICE_NAME, new AtomicLongService());
registerService(AtomicReferenceService.SERVICE_NAME, new AtomicReferenceService());
registerService(CountDownLatchService.SERVICE_NAME, new CountDownLatchService());
registerService(SemaphoreService.SERVICE_NAME, new SemaphoreService(nodeEngine));
registerService(IdGeneratorService.SERVICE_NAME, new IdGeneratorService(nodeEngine));
registerService(MapReduceService.SERVICE_NAME, new MapReduceService(nodeEngine));
registerService(ReplicatedMapService.SERVICE_NAME, new ReplicatedMapService(nodeEngine));
registerService(RingbufferService.SERVICE_NAME, new RingbufferService(nodeEngine));
registerService(XAService.SERVICE_NAME, new XAService(nodeEngine));
registerService(CardinalityEstimatorService.SERVICE_NAME, new CardinalityEstimatorService());
registerService(DistributedScheduledExecutorService.SERVICE_NAME, new DistributedScheduledExecutorService());
registerCacheServiceIfAvailable();
readServiceDescriptors();
}
use of com.hazelcast.ringbuffer.impl.RingbufferService in project hazelcast by hazelcast.
the class PartitionControlledIdTest method testRingbuffer.
@Test
public void testRingbuffer() throws Exception {
String partitionKey = "hazelcast";
HazelcastInstance hz = getHazelcastInstance(partitionKey);
Ringbuffer ringbuffer = hz.getRingbuffer("ringbuffer@" + partitionKey);
ringbuffer.add("foo");
assertEquals("ringbuffer@" + partitionKey, ringbuffer.getName());
assertEquals(partitionKey, ringbuffer.getPartitionKey());
RingbufferService service = getNodeEngine(hz).getService(RingbufferService.SERVICE_NAME);
assertTrue(service.getContainers().containsKey(ringbuffer.getName()));
}
use of com.hazelcast.ringbuffer.impl.RingbufferService in project hazelcast by hazelcast.
the class ReliableTopicCreateTest method testConstruction.
@Test
public void testConstruction() {
HazelcastInstance hz = createHazelcastInstance();
RingbufferService ringbufferService = getNodeEngineImpl(hz).getService(RingbufferService.SERVICE_NAME);
ReliableTopicProxy<String> topic = (ReliableTopicProxy<String>) hz.<String>getReliableTopic("foo");
Ringbuffer ringbuffer = hz.getRingbuffer(RingbufferService.TOPIC_RB_PREFIX + "foo");
assertSame(ringbuffer, topic.ringbuffer);
// make sure the ringbuffer and topic are hooked up correctly
topic.publish("item1");
topic.publish("item2");
assertEquals(0, ringbuffer.headSequence());
assertEquals(1, ringbuffer.tailSequence());
ConcurrentMap<String, RingbufferContainer> containers = ringbufferService.getContainers();
assertEquals(1, containers.size());
assertTrue(containers.containsKey(ringbuffer.getName()));
}
use of com.hazelcast.ringbuffer.impl.RingbufferService in project hazelcast by hazelcast.
the class ReliableTopicCreateTest method testRingbufferConfiguration.
@Test
public void testRingbufferConfiguration() {
Config config = new Config();
RingbufferConfig rbConfig = new RingbufferConfig("foo").setCapacity(21);
config.addRingBufferConfig(rbConfig);
HazelcastInstance hz = createHazelcastInstance(config);
RingbufferService ringbufferService = getNodeEngineImpl(hz).getService(RingbufferService.SERVICE_NAME);
ReliableTopicProxy topic = (ReliableTopicProxy) hz.getReliableTopic("foo");
Ringbuffer ringbuffer = hz.getRingbuffer(RingbufferService.TOPIC_RB_PREFIX + "foo");
assertSame(ringbuffer, topic.ringbuffer);
assertEquals(21, ringbuffer.capacity());
// triggers the creation
ringbuffer.size();
ConcurrentMap<String, RingbufferContainer> containers = ringbufferService.getContainers();
assertEquals(1, containers.size());
assertTrue(containers.containsKey(ringbuffer.getName()));
RingbufferContainer container = containers.get(ringbuffer.getName());
assertEquals(rbConfig.getCapacity(), container.getConfig().getCapacity());
}
Aggregations