Search in sources :

Example 71 with MapService

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;
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) MapNearCacheManager(com.hazelcast.map.impl.nearcache.MapNearCacheManager) Invalidator(com.hazelcast.internal.nearcache.impl.invalidation.Invalidator) HashMap(java.util.HashMap) UUID(java.util.UUID) MapService(com.hazelcast.map.impl.MapService) MetaDataGenerator(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 72 with MapService

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);
}
Also used : Config(com.hazelcast.config.Config) MapService(com.hazelcast.map.impl.MapService) Before(org.junit.Before)

Example 73 with MapService

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());
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) MapService(com.hazelcast.map.impl.MapService) Before(org.junit.Before)

Example 74 with MapService

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();
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) MapService(com.hazelcast.map.impl.MapService)

Example 75 with MapService

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();
}
Also used : MapNearCacheManager(com.hazelcast.map.impl.nearcache.MapNearCacheManager) MapService(com.hazelcast.map.impl.MapService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Aggregations

MapService (com.hazelcast.map.impl.MapService)80 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)44 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)20 HazelcastInstance (com.hazelcast.core.HazelcastInstance)13 MapNearCacheManager (com.hazelcast.map.impl.nearcache.MapNearCacheManager)13 MetaDataGenerator (com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator)12 Invalidator (com.hazelcast.internal.nearcache.impl.invalidation.Invalidator)11 MapContainer (com.hazelcast.map.impl.MapContainer)10 MapProxyImpl (com.hazelcast.map.impl.proxy.MapProxyImpl)10 ParallelTest (com.hazelcast.test.annotation.ParallelTest)9 QuickTest (com.hazelcast.test.annotation.QuickTest)9 Test (org.junit.Test)9 RecordStore (com.hazelcast.map.impl.recordstore.RecordStore)8 Config (com.hazelcast.config.Config)7 Before (org.junit.Before)7 Data (com.hazelcast.nio.serialization.Data)6 Map (java.util.Map)6 Address (com.hazelcast.nio.Address)5 IPartitionLostEvent (com.hazelcast.spi.partition.IPartitionLostEvent)5 PartitionContainer (com.hazelcast.map.impl.PartitionContainer)4