use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class ClientMapInvalidationMetadataDistortionTest 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.MapServiceContext in project hazelcast by hazelcast.
the class MapNearCacheInvalidationFromClientTest method getNearCache.
@SuppressWarnings("unchecked")
private NearCache<Object, Object> getNearCache(HazelcastInstance instance, String mapName) {
MapServiceContext mapServiceContext = getMapService(instance).getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
NearCacheConfig nearCacheConfig = getNodeEngineImpl(instance).getConfig().findMapConfig(mapName).getNearCacheConfig();
return mapNearCacheManager.getOrCreateNearCache(mapName, nearCacheConfig);
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class ClientMapInvalidationMetaDataFetcherTest 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.MapServiceContext in project hazelcast by hazelcast.
the class MetadataResolver method resolve.
@Nullable
@Override
public Mapping resolve(String iMapName) {
MapService service = nodeEngine.getService(MapService.SERVICE_NAME);
MapServiceContext context = service.getMapServiceContext();
MapContainer container = context.getExistingMapContainer(iMapName);
if (container == null) {
return null;
}
boolean hd = container.getMapConfig().getInMemoryFormat() == InMemoryFormat.NATIVE;
Metadata metadata = hd ? resolveFromHd(container) : resolveFromHeap(iMapName, context);
return metadata == null ? null : new Mapping(iMapName, iMapName, TYPE_NAME, metadata.fields(), metadata.options());
}
use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.
the class ClientQueryCacheMemoryLeakTest method getPublisherContext.
private static PublisherContext getPublisherContext(HazelcastInstance node) {
MapService mapService = getNodeEngineImpl(node).getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext();
return queryCacheContext.getPublisherContext();
}
Aggregations