use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapAssignAndGetUuidsOperation method getMetaDataGenerator.
private MetaDataGenerator getMetaDataGenerator() {
MapService mapService = getService();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
return invalidator.getMetaDataGenerator();
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapEvictAllMessageTask method reduce.
@Override
protected Object reduce(Map<Integer, Object> map) {
MapService mapService = getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
int evictedTotal = 0;
for (Object result : map.values()) {
Integer size = (Integer) mapServiceContext.toObject(result);
evictedTotal += size;
}
if (evictedTotal > 0) {
Address thisAddress = mapServiceContext.getNodeEngine().getThisAddress();
MapEventPublisher mapEventPublisher = mapServiceContext.getMapEventPublisher();
mapEventPublisher.publishMapEvent(thisAddress, parameters.name, EVICT_ALL, evictedTotal);
}
return null;
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class AbstractMapAddEntryListenerMessageTask method call.
@Override
protected Object call() {
final ClientEndpoint endpoint = getEndpoint();
final MapService mapService = getService(MapService.SERVICE_NAME);
Object listener = newMapListener();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
String name = getDistributedObjectName();
EventFilter eventFilter = getEventFilter();
String registrationId;
if (isLocalOnly()) {
registrationId = mapServiceContext.addLocalEventListener(listener, eventFilter, name);
} else {
registrationId = mapServiceContext.addEventListener(listener, eventFilter, name);
}
endpoint.addListenerDestroyAction(MapService.SERVICE_NAME, name, registrationId);
return registrationId;
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapExecuteWithPredicateMessageTask method reduce.
@Override
protected Object reduce(Map<Integer, Object> map) {
List<Map.Entry<Data, Data>> dataMap = new ArrayList<Map.Entry<Data, Data>>();
MapService mapService = getService(MapService.SERVICE_NAME);
for (Object o : map.values()) {
if (o != null) {
MapEntries mapEntries = (MapEntries) mapService.getMapServiceContext().toObject(o);
mapEntries.putAllToList(dataMap);
}
}
return dataMap;
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapFlushMessageTask method call.
@Override
protected Object call() throws Exception {
MapService mapService = getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
ProxyService proxyService = nodeEngine.getProxyService();
DistributedObject distributedObject = proxyService.getDistributedObject(SERVICE_NAME, parameters.name);
MapProxyImpl mapProxy = (MapProxyImpl) distributedObject;
mapProxy.flush();
return null;
}
Aggregations