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);
}
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;
}
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) } });
}
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));
}
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));
}
Aggregations