use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapInvalidationMetaDataMigrationTest method getPartitionToUuidMap.
private Map<Integer, UUID> getPartitionToUuidMap(HazelcastInstance instance) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(instance);
int partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
HashMap<Integer, UUID> partitionToSequenceMap = new HashMap<Integer, UUID>(partitionCount);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
for (int i = 0; i < partitionCount; i++) {
partitionToSequenceMap.put(i, metaDataGenerator.getUuidOrNull(i));
}
return partitionToSequenceMap;
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapQueryEngineImpl_queryLocalPartition_resultSizeLimitTest method setup.
@Before
public void setup() {
Config config = new Config();
// we reduce the number of partitions to speed up content generation
config.setProperty(GroupProperty.PARTITION_COUNT.getName(), "" + PARTITION_COUNT);
config.setProperty(GroupProperty.QUERY_RESULT_SIZE_LIMIT.getName(), "" + RESULT_SIZE_LIMIT);
hz = createHazelcastInstance(config);
map = hz.getMap(randomName());
MapService mapService = getNodeEngineImpl(hz).getService(MapService.SERVICE_NAME);
queryEngine = new MapQueryEngineImpl(mapService.getMapServiceContext());
// we just fill a single partition, so we get the NodeResultLimit for a single partition as well
QueryResultSizeLimiter resultSizeLimiter = queryEngine.getQueryResultSizeLimiter();
limit = (int) resultSizeLimiter.getNodeResultLimit(1);
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapQueryEngineImpl_queryLocalPartitions_resultSizeNoLimitTest method setup.
@Before
public void setup() {
HazelcastInstance hz = createHazelcastInstance();
map = hz.getMap(randomName());
MapService mapService = getNodeEngineImpl(hz).getService(MapService.SERVICE_NAME);
queryEngine = new MapQueryEngineImpl(mapService.getMapServiceContext());
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class NearCacheTestUtils method getMapNearCacheManager.
/**
* Returns the {@link MapNearCacheManager} from a given {@link HazelcastInstance}.
*
* @param instance the {@link HazelcastInstance} to retrieve the {@link MapNearCacheManager} frp,
* @return the {@link MapNearCacheManager}
*/
public static MapNearCacheManager getMapNearCacheManager(HazelcastInstance instance) {
NodeEngineImpl nodeEngine = getNode(instance).nodeEngine;
MapService service = nodeEngine.getService(MapService.SERVICE_NAME);
return service.getMapServiceContext().getMapNearCacheManager();
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MetaDataGeneratorTest method getMetaDataGenerator.
protected MetaDataGenerator getMetaDataGenerator(HazelcastInstance member) {
MapService mapService = getNodeEngineImpl(member).getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
return invalidator.getMetaDataGenerator();
}
Aggregations