use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class IndexIntegrationTest method getIndexOfAttributeForMap.
private static List<Index> getIndexOfAttributeForMap(HazelcastInstance instance, String mapName, String attribute) {
Node node = getNode(instance);
MapService service = node.nodeEngine.getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = service.getMapServiceContext();
MapContainer mapContainer = mapServiceContext.getMapContainer(mapName);
List<Index> result = new ArrayList<>();
for (int partitionId : mapServiceContext.getOrInitCachedMemberPartitions()) {
Indexes indexes = mapContainer.getIndexes(partitionId);
for (InternalIndex index : indexes.getIndexes()) {
for (String component : index.getComponents()) {
if (component.equals(IndexUtils.canonicalizeAttribute(attribute))) {
result.add(index);
break;
}
}
}
}
return result;
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class StaleReadDetectorTest method isRepairingHandlerCreatedForMap.
private static boolean isRepairingHandlerCreatedForMap(HazelcastInstance node, String mapName) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(node);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
ConcurrentMap<String, RepairingHandler> handlers = mapNearCacheManager.getRepairingTask().getHandlers();
RepairingHandler repairingHandler = handlers.get(mapName);
return repairingHandler != null;
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class ClientMapInvalidationMetaDataFetcherTest 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.MapServiceContext in project hazelcast by hazelcast.
the class ClientMapStoreTest method getMapStoreInstance.
// given a member-side HazelcastInstance and a mapName, return the MapStore instance
// or null if none configured
private <T extends MapStore> T getMapStoreInstance(HazelcastInstance hz, String mapName) {
MapProxyImpl map = (MapProxyImpl) hz.getMap(mapName);
MapService service = (MapService) map.getService();
MapServiceContext context = service.getMapServiceContext();
MapContainer container = context.getMapContainer(mapName);
return (T) container.getMapStoreContext().getMapStoreWrapper().getMapStore();
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class MapAddListenerMessageTask method registerListener.
private String registerListener(ClientEndpoint endpoint, ListenerAdapter adapter) {
MapService mapService = getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
String registrationId;
if (parameters.localOnly) {
registrationId = mapServiceContext.addLocalListenerAdapter(adapter, parameters.listenerName);
} else {
registrationId = mapServiceContext.addListenerAdapter(adapter, TrueEventFilter.INSTANCE, parameters.listenerName);
}
endpoint.addListenerDestroyAction(MapService.SERVICE_NAME, parameters.listenerName, registrationId);
return registrationId;
}
Aggregations