Search in sources :

Example 11 with ReplicatedMapService

use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.

the class ContainsValueOperation method run.

@Override
public void run() throws Exception {
    ReplicatedMapService service = getService();
    Collection<ReplicatedRecordStore> stores = service.getAllReplicatedRecordStores(name);
    for (ReplicatedRecordStore store : stores) {
        if (store.containsValue(value)) {
            response = true;
            break;
        }
    }
}
Also used : ReplicatedRecordStore(com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService)

Example 12 with ReplicatedMapService

use of com.hazelcast.replicatedmap.impl.ReplicatedMapService 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();
}
Also used : DistributedDurableExecutorService(com.hazelcast.durableexecutor.impl.DistributedDurableExecutorService) XAService(com.hazelcast.transaction.impl.xa.XAService) SemaphoreService(com.hazelcast.concurrent.semaphore.SemaphoreService) MultiMapService(com.hazelcast.multimap.impl.MultiMapService) LockServiceImpl(com.hazelcast.concurrent.lock.LockServiceImpl) SetService(com.hazelcast.collection.impl.set.SetService) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) QueueService(com.hazelcast.collection.impl.queue.QueueService) IdGeneratorService(com.hazelcast.concurrent.idgen.IdGeneratorService) ListService(com.hazelcast.collection.impl.list.ListService) TopicService(com.hazelcast.topic.impl.TopicService) ReliableTopicService(com.hazelcast.topic.impl.reliable.ReliableTopicService) DistributedScheduledExecutorService(com.hazelcast.scheduledexecutor.impl.DistributedScheduledExecutorService) ReliableTopicService(com.hazelcast.topic.impl.reliable.ReliableTopicService) AtomicLongService(com.hazelcast.concurrent.atomiclong.AtomicLongService) DistributedExecutorService(com.hazelcast.executor.impl.DistributedExecutorService) CountDownLatchService(com.hazelcast.concurrent.countdownlatch.CountDownLatchService) MapReduceService(com.hazelcast.mapreduce.impl.MapReduceService) RingbufferService(com.hazelcast.ringbuffer.impl.RingbufferService) MultiMapService(com.hazelcast.multimap.impl.MultiMapService) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) MapService(com.hazelcast.map.impl.MapService) CardinalityEstimatorService(com.hazelcast.cardinality.impl.CardinalityEstimatorService) AtomicReferenceService(com.hazelcast.concurrent.atomicreference.AtomicReferenceService)

Example 13 with ReplicatedMapService

use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.

the class ReplicatedMapLiteMemberTest method testCreateReplicatedStoreOnLiteMember.

@Test(expected = ReplicatedMapCantBeCreatedOnLiteMemberException.class)
public void testCreateReplicatedStoreOnLiteMember() {
    final HazelcastInstance lite = createSingleLiteMember();
    final ReplicatedMapService service = getReplicatedMapService(lite);
    service.getReplicatedRecordStore("default", true, 1);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 14 with ReplicatedMapService

use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.

the class AbstractReplicatedMapAddEntryListenerMessageTask method call.

@Override
protected Object call() {
    ReplicatedMapService service = getService(ReplicatedMapService.SERVICE_NAME);
    ReplicatedMapEventPublishingService eventPublishingService = service.getEventPublishingService();
    String registrationId;
    Predicate predicate = getPredicate();
    if (predicate == null) {
        registrationId = eventPublishingService.addEventListener(this, new ReplicatedEntryEventFilter(getKey()), getDistributedObjectName());
    } else {
        registrationId = eventPublishingService.addEventListener(this, new ReplicatedQueryEventFilter(getKey(), predicate), getDistributedObjectName());
    }
    endpoint.addListenerDestroyAction(ReplicatedMapService.SERVICE_NAME, getDistributedObjectName(), registrationId);
    return registrationId;
}
Also used : ReplicatedQueryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedQueryEventFilter) ReplicatedEntryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) ReplicatedMapEventPublishingService(com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService) Predicate(com.hazelcast.query.Predicate)

Example 15 with ReplicatedMapService

use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.

the class ReplicatedMapClearMessageTask method reduce.

@Override
protected Object reduce(Map<Integer, Object> map) {
    int deletedEntrySize = 0;
    for (Object deletedEntryPerPartition : map.values()) {
        deletedEntrySize += (Integer) deletedEntryPerPartition;
    }
    ReplicatedMapService service = getService(getServiceName());
    ReplicatedMapEventPublishingService eventPublishingService = service.getEventPublishingService();
    eventPublishingService.fireMapClearedEvent(deletedEntrySize, getDistributedObjectName());
    return null;
}
Also used : ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) ReplicatedMapEventPublishingService(com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService)

Aggregations

ReplicatedMapService (com.hazelcast.replicatedmap.impl.ReplicatedMapService)32 ReplicatedRecordStore (com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore)17 ILogger (com.hazelcast.logging.ILogger)6 Data (com.hazelcast.nio.serialization.Data)6 ReplicatedMapEventPublishingService (com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService)6 HazelcastInstance (com.hazelcast.core.HazelcastInstance)5 Test (org.junit.Test)5 ReplicatedRecord (com.hazelcast.replicatedmap.impl.record.ReplicatedRecord)4 ParallelTest (com.hazelcast.test.annotation.ParallelTest)4 QuickTest (com.hazelcast.test.annotation.QuickTest)4 Config (com.hazelcast.config.Config)3 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)3 SerializationService (com.hazelcast.spi.serialization.SerializationService)3 ArrayList (java.util.ArrayList)3 QueueService (com.hazelcast.collection.impl.queue.QueueService)2 DistributedExecutorService (com.hazelcast.executor.impl.DistributedExecutorService)2 MapService (com.hazelcast.map.impl.MapService)2 MultiMapService (com.hazelcast.multimap.impl.MultiMapService)2 Address (com.hazelcast.nio.Address)2 PartitionContainer (com.hazelcast.replicatedmap.impl.PartitionContainer)2