use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapClearMessageTask method reduce.
@Override
protected Object reduce(Map<Integer, Object> map) {
int clearedTotal = 0;
for (Object affectedEntries : map.values()) {
clearedTotal += (Integer) affectedEntries;
}
MapService service = getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = service.getMapServiceContext();
if (clearedTotal > 0) {
Address thisAddress = nodeEngine.getThisAddress();
MapEventPublisher mapEventPublisher = mapServiceContext.getMapEventPublisher();
mapEventPublisher.publishMapEvent(thisAddress, parameters.name, CLEAR_ALL, clearedTotal);
}
return null;
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapExecuteOnAllKeysMessageTask 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 entries = (MapEntries) mapService.getMapServiceContext().toObject(o);
entries.putAllToList(dataMap);
}
}
return dataMap;
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class ClientMapMetaDataFetcherTest method distortRandomPartitionUuid.
private void distortRandomPartitionUuid(int partition, UUID uuid, 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.setUuid(partition, uuid);
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class InvalidationMetadataDistortionTest method distortRandomPartitionSequence.
private void distortRandomPartitionSequence(String mapName, 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();
InternalPartitionService partitionService = nodeEngineImpl.getPartitionService();
int partitionCount = partitionService.getPartitionCount();
metaDataGenerator.setCurrentSequence(mapName, getInt(partitionCount), getInt(MAX_VALUE));
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class InvalidationMetadataDistortionTest method distortRandomPartitionUuid.
private void distortRandomPartitionUuid(HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
int partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
int partitionId = getInt(partitionCount);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
metaDataGenerator.setUuid(partitionId, UuidUtil.newSecureUUID());
}
Aggregations