Search in sources :

Example 26 with MapServiceContext

use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.

the class IndexIntegrationTest method getIndexOfAttributeForMap.

private static 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);
    Indexes indexes = mapContainer.getIndexes();
    return indexes.getIndex(attribute);
}
Also used : Node(com.hazelcast.instance.Node) MapService(com.hazelcast.map.impl.MapService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext) MapContainer(com.hazelcast.map.impl.MapContainer)

Example 27 with MapServiceContext

use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.

the class DynamicMapConfigTest method isEvictionEnabled.

private boolean isEvictionEnabled(IMap map) {
    MapProxyImpl mapProxy = (MapProxyImpl) map;
    MapService mapService = (MapService) mapProxy.getService();
    MapServiceContext mapServiceContext = (MapServiceContext) mapService.getMapServiceContext();
    MapContainer mapContainer = mapServiceContext.getMapContainer(map.getName());
    EvictionPolicy evictionPolicy = mapContainer.getMapConfig().getEvictionPolicy();
    return evictionPolicy != NONE;
}
Also used : EvictionPolicy(com.hazelcast.config.EvictionPolicy) MapProxyImpl(com.hazelcast.map.impl.proxy.MapProxyImpl) MapService(com.hazelcast.map.impl.MapService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext) MapContainer(com.hazelcast.map.impl.MapContainer)

Example 28 with MapServiceContext

use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.

the class EntryEventDataCacheTest method parameters.

@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> parameters() {
    // setup mock MapServiceContext & NodeEngine, required by FilteringStrategy's
    MapServiceContext mapServiceContext = mock(MapServiceContext.class);
    NodeEngine mockNodeEngine = mock(NodeEngine.class);
    when(mockNodeEngine.getThisAddress()).thenReturn(ADDRESS);
    when(mapServiceContext.toData(anyObject())).thenReturn(new HeapData());
    when(mapServiceContext.getNodeEngine()).thenReturn(mockNodeEngine);
    return Arrays.asList(new Object[][] { { new DefaultEntryEventFilteringStrategy(null, mapServiceContext) }, { new QueryCacheNaturalFilteringStrategy(null, mapServiceContext) } });
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) HeapData(com.hazelcast.internal.serialization.impl.HeapData) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 29 with MapServiceContext

use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.

the class QueryCacheEventLostListenerTest method setTestSequencer.

private void setTestSequencer(HazelcastInstance instance, int eventCount) {
    Node node = getNode(instance);
    MapService service = node.getNodeEngine().getService(MapService.SERVICE_NAME);
    MapServiceContext mapServiceContext = service.getMapServiceContext();
    QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext();
    queryCacheContext.setSubscriberContext(new TestSubscriberContext(queryCacheContext, eventCount, true));
}
Also used : TestSubscriberContext(com.hazelcast.map.impl.querycache.subscriber.TestSubscriberContext) Node(com.hazelcast.instance.Node) MapService(com.hazelcast.map.impl.MapService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 30 with MapServiceContext

use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.

the class QueryCacheRecoveryUponEventLossTest method setTestSequencer.

private void setTestSequencer(HazelcastInstance instance, int eventCount) {
    Node node = getNode(instance);
    MapService service = node.getNodeEngine().getService(MapService.SERVICE_NAME);
    MapServiceContext mapServiceContext = service.getMapServiceContext();
    QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext();
    queryCacheContext.setSubscriberContext(new TestSubscriberContext(queryCacheContext, eventCount, true));
}
Also used : TestSubscriberContext(com.hazelcast.map.impl.querycache.subscriber.TestSubscriberContext) Node(com.hazelcast.instance.Node) MapService(com.hazelcast.map.impl.MapService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Aggregations

MapServiceContext (com.hazelcast.map.impl.MapServiceContext)63 MapService (com.hazelcast.map.impl.MapService)44 MapNearCacheManager (com.hazelcast.map.impl.nearcache.MapNearCacheManager)15 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)14 Invalidator (com.hazelcast.internal.nearcache.impl.invalidation.Invalidator)12 RecordStore (com.hazelcast.map.impl.recordstore.RecordStore)12 MetaDataGenerator (com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator)10 NodeEngine (com.hazelcast.spi.NodeEngine)10 MapProxyImpl (com.hazelcast.map.impl.proxy.MapProxyImpl)7 HazelcastInstance (com.hazelcast.core.HazelcastInstance)6 MapContainer (com.hazelcast.map.impl.MapContainer)6 Data (com.hazelcast.nio.serialization.Data)6 PartitionContainer (com.hazelcast.map.impl.PartitionContainer)5 MapStoreConfig (com.hazelcast.config.MapStoreConfig)4 SimpleEntryView (com.hazelcast.map.impl.SimpleEntryView)4 HashMap (java.util.HashMap)4 Config (com.hazelcast.config.Config)3 MapConfig (com.hazelcast.config.MapConfig)3 NearCacheConfig (com.hazelcast.config.NearCacheConfig)3 Node (com.hazelcast.instance.Node)3