use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class ClearExpiredOperation method afterRun.
@Override
public void afterRun() throws Exception {
final MapService mapService = getService();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
final PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(getPartitionId());
partitionContainer.setHasRunningCleanup(false);
partitionContainer.setLastCleanupTime(Clock.currentTimeMillis());
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class PostJoinMapOperation method run.
@Override
public void run() throws Exception {
MapService mapService = getService();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
for (MapIndexInfo mapIndex : indexInfoList) {
final MapContainer mapContainer = mapServiceContext.getMapContainer(mapIndex.mapName);
final Indexes indexes = mapContainer.getIndexes();
for (MapIndexInfo.IndexInfo indexInfo : mapIndex.lsIndexes) {
indexes.addOrGetIndex(indexInfo.attributeName, indexInfo.ordered);
}
}
for (InterceptorInfo interceptorInfo : interceptorInfoList) {
final MapContainer mapContainer = mapServiceContext.getMapContainer(interceptorInfo.mapName);
InterceptorRegistry interceptorRegistry = mapContainer.getInterceptorRegistry();
Map<String, MapInterceptor> interceptorMap = interceptorRegistry.getId2InterceptorMap();
List<Map.Entry<String, MapInterceptor>> entryList = interceptorInfo.interceptors;
for (Map.Entry<String, MapInterceptor> entry : entryList) {
if (!interceptorMap.containsKey(entry.getKey())) {
interceptorRegistry.register(entry.getKey(), entry.getValue());
}
}
}
createQueryCaches();
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapKeyValueSource method open.
@Override
public boolean open(NodeEngine nodeEngine) {
NodeEngineImpl nei = (NodeEngineImpl) nodeEngine;
IPartitionService ps = nei.getPartitionService();
MapService mapService = nei.getService(MapService.SERVICE_NAME);
ss = nei.getSerializationService();
Address partitionOwner = ps.getPartitionOwner(partitionId);
if (partitionOwner == null) {
return false;
}
RecordStore recordStore = mapService.getMapServiceContext().getRecordStore(partitionId, mapName);
iterator = recordStore.iterator();
return true;
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class AbstractMapPartitionMessageTask method getMapOperationProvider.
protected final MapOperationProvider getMapOperationProvider(String mapName) {
MapService mapService = getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
return mapServiceContext.getMapOperationProvider(mapName);
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapAddPartitionLostListenerMessageTask method call.
@Override
protected Object call() {
final ClientEndpoint endpoint = getEndpoint();
final MapService mapService = getService(MapService.SERVICE_NAME);
final MapPartitionLostListener listener = new MapPartitionLostListener() {
@Override
public void partitionLost(MapPartitionLostEvent event) {
if (endpoint.isAlive()) {
ClientMessage eventMessage = MapAddPartitionLostListenerCodec.encodeMapPartitionLostEvent(event.getPartitionId(), event.getMember().getUuid());
sendClientMessage(null, eventMessage);
}
}
};
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
String registrationId;
if (parameters.localOnly) {
registrationId = mapServiceContext.addLocalPartitionLostListener(listener, parameters.name);
} else {
registrationId = mapServiceContext.addPartitionLostListener(listener, parameters.name);
}
endpoint.addListenerDestroyAction(MapService.SERVICE_NAME, parameters.name, registrationId);
return registrationId;
}
Aggregations