use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapIsEmptyMessageTask method reduce.
@Override
protected Object reduce(Map<Integer, Object> map) {
MapService mapService = getService(MapService.SERVICE_NAME);
boolean response = true;
for (Object result : map.values()) {
boolean isEmpty = (Boolean) mapService.getMapServiceContext().toObject(result);
if (!isEmpty) {
response = false;
}
}
return response;
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapLoadAllMessageTask method call.
@Override
protected Object call() {
final MapService mapService = getService(MapService.SERVICE_NAME);
final DistributedObject distributedObject = mapService.getMapServiceContext().getNodeEngine().getProxyService().getDistributedObject(MapService.SERVICE_NAME, parameters.name);
final MapProxyImpl mapProxy = (MapProxyImpl) distributedObject;
mapProxy.loadAll(parameters.replaceExistingValues);
return null;
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class ClientMapMetaDataFetcherTest method distortRandomPartitionSequence.
private void distortRandomPartitionSequence(String mapName, int partition, long sequence, HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
metaDataGenerator.setCurrentSequence(mapName, partition, sequence);
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class DynamicMapConfigTest method isEvictionEnabled.
private boolean isEvictionEnabled(IMap map) {
MapProxyImpl mapProxy = (MapProxyImpl) map;
MapService mapService = (MapService) mapProxy.getService();
MapServiceContext mapServiceContext = (MapServiceContext) mapService.getMapServiceContext();
MapContainer mapContainer = mapServiceContext.getMapContainer(map.getName());
EvictionPolicy evictionPolicy = mapContainer.getMapConfig().getEvictionPolicy();
return evictionPolicy != NONE;
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapPartitionLostListenerTest method test_partitionLostListenerInvoked_whenEntryListenerIsAlsoRegistered.
@Test
public void test_partitionLostListenerInvoked_whenEntryListenerIsAlsoRegistered() {
List<HazelcastInstance> instances = getCreatedInstancesShuffledAfterWarmedUp(1);
HazelcastInstance instance = instances.get(0);
final TestEventCollectingMapPartitionLostListener listener = new TestEventCollectingMapPartitionLostListener(0);
instance.getMap(getIthMapName(0)).addPartitionLostListener(listener);
instance.getMap(getIthMapName(0)).addEntryListener(mock(EntryAddedListener.class), true);
final IPartitionLostEvent internalEvent = new IPartitionLostEvent(1, 0, null);
MapService mapService = getNode(instance).getNodeEngine().getService(MapService.SERVICE_NAME);
mapService.onPartitionLost(internalEvent);
assertEventEventually(listener, internalEvent);
}
Aggregations