use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapPartitionLostListenerTest method test_partitionLostListenerInvoked.
@Test
public void test_partitionLostListenerInvoked() {
List<HazelcastInstance> instances = getCreatedInstancesShuffledAfterWarmedUp(1);
HazelcastInstance instance = instances.get(0);
final TestEventCollectingMapPartitionLostListener listener = new TestEventCollectingMapPartitionLostListener(0);
instance.getMap(getIthMapName(0)).addPartitionLostListener(listener);
final IPartitionLostEvent internalEvent = new IPartitionLostEvent(1, 0, null);
MapService mapService = getNode(instance).getNodeEngine().getService(MapService.SERVICE_NAME);
mapService.onPartitionLost(internalEvent);
assertEventEventually(listener, internalEvent);
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class QueryCacheEventLostListenerTest method setTestSequencer.
private void setTestSequencer(HazelcastInstance instance, int eventCount) {
Node node = getNode(instance);
MapService service = node.getNodeEngine().getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = service.getMapServiceContext();
QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext();
queryCacheContext.setSubscriberContext(new TestSubscriberContext(queryCacheContext, eventCount, true));
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class QueryCacheRecoveryUponEventLossTest method setTestSequencer.
private void setTestSequencer(HazelcastInstance instance, int eventCount) {
Node node = getNode(instance);
MapService service = node.getNodeEngine().getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = service.getMapServiceContext();
QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext();
queryCacheContext.setSubscriberContext(new TestSubscriberContext(queryCacheContext, eventCount, true));
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class QueryDispatcherTest method before.
@Before
public void before() {
instance = createHazelcastInstance();
map = instance.getMap(randomName());
MapService mapService = getNodeEngineImpl(instance).getService(MapService.SERVICE_NAME);
queryDispatcher = new QueryDispatcher(mapService.getMapServiceContext());
partitionId = 100;
key = generateKeyForPartition(instance, partitionId);
value = randomString();
map.put(key, value);
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class NodeQueryCacheContextTest method setUp.
@Before
public void setUp() {
HazelcastInstance hz = createHazelcastInstance();
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(hz);
MapService mapService = nodeEngineImpl.getService(MapService.SERVICE_NAME);
context = mapService.getMapServiceContext().getQueryCacheContext();
partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
}
Aggregations