use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.
the class ReplicatedMapTtlTest method service_reset_empties_internal_ttl_schedulers.
@Test
public void service_reset_empties_internal_ttl_schedulers() {
HazelcastInstance node = createHazelcastInstance();
String mapName = "test";
ReplicatedMap map = node.getReplicatedMap(mapName);
for (int i = 0; i < 1000; i++) {
map.put(i, i, 100, TimeUnit.DAYS);
}
ReplicatedMapService service = getNodeEngineImpl(node).getService(ReplicatedMapService.SERVICE_NAME);
service.reset();
assertAllTtlSchedulersEmpty(map);
}
use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.
the class AbstractBaseReplicatedRecordStoreTest method setUp.
@Before
public void setUp() {
HazelcastInstance instance = createHazelcastInstance();
NodeEngineImpl nodeEngine = getNodeEngineImpl(instance);
ReplicatedMapService service = new ReplicatedMapService(nodeEngine);
recordStore = new TestReplicatedRecordStore("recordStore", service, 0);
recordStoreSameAttributes = new TestReplicatedRecordStore("recordStore", service, 0);
recordStoreSameAttributes.storageRef.set(recordStore.storageRef.get());
recordStoreOtherStorage = new TestReplicatedRecordStore("recordStore", service, 0);
recordStoreOtherName = new TestReplicatedRecordStore("otherRecordStore", service, 0);
}
use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.
the class AbstractReplicatedMapAddEntryListenerMessageTask method processInternal.
@Override
protected CompletableFuture<UUID> processInternal() {
ReplicatedMapService service = getService(ReplicatedMapService.SERVICE_NAME);
ReplicatedMapEventPublishingService eventPublishingService = service.getEventPublishingService();
Predicate predicate = getPredicate();
ReplicatedEntryEventFilter filter;
if (predicate == null) {
filter = new ReplicatedEntryEventFilter(getKey());
} else {
filter = new ReplicatedQueryEventFilter(getKey(), predicate);
}
return newCompletedFuture(eventPublishingService.addLocalEventListener(this, filter, getDistributedObjectName()));
}
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;
}
use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.
the class ReplicatedMapRemoveEntryListenerMessageTask method deRegisterListener.
@Override
protected Future<Boolean> deRegisterListener() {
ReplicatedMapService service = getService(ReplicatedMapService.SERVICE_NAME);
ReplicatedMapEventPublishingService eventPublishingService = service.getEventPublishingService();
return eventPublishingService.removeEventListenerAsync(parameters.name, parameters.registrationId);
}
Aggregations