use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapStoreTest method testReadingConfiguration.
@Test(timeout = 120000)
public void testReadingConfiguration() throws Exception {
String mapName = "mapstore-test";
InputStream is = getClass().getResourceAsStream("/com/hazelcast/config/hazelcast-mapstore-config.xml");
XmlConfigBuilder builder = new XmlConfigBuilder(is);
Config config = builder.build();
HazelcastInstance hz = createHazelcastInstance(config);
MapProxyImpl map = (MapProxyImpl) hz.getMap(mapName);
MapService mapService = (MapService) map.getService();
MapContainer mapContainer = mapService.getMapServiceContext().getMapContainer(mapName);
MapStoreWrapper mapStoreWrapper = mapContainer.getMapStoreContext().getMapStoreWrapper();
Iterator keys = mapStoreWrapper.loadAllKeys().iterator();
final Set<String> loadedKeySet = loadedKeySet(keys);
final Set<String> expectedKeySet = expectedKeySet();
assertEquals(expectedKeySet, loadedKeySet);
assertEquals("true", mapStoreWrapper.load("my-prop-1"));
assertEquals("foo", mapStoreWrapper.load("my-prop-2"));
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class QueryCacheUtilTest method setUp.
@Before
public void setUp() {
HazelcastInstance instance = createHazelcastInstance();
MapService mapService = getNodeEngineImpl(instance).getService(MapService.SERVICE_NAME);
context = new NodeQueryCacheContext(mapService.getMapServiceContext());
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class AbstractMapAllPartitionsMessageTask method getOperationProvider.
protected final MapOperationProvider getOperationProvider(String mapName) {
MapService mapService = getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
return mapServiceContext.getMapOperationProvider(mapName);
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class AbstractMapPutMessageTask method beforeResponse.
@Override
protected void beforeResponse() {
final long latency = System.currentTimeMillis() - startTime;
final MapService mapService = getService(MapService.SERVICE_NAME);
MapContainer mapContainer = mapService.getMapServiceContext().getMapContainer(getDistributedObjectName());
if (mapContainer.getMapConfig().isStatisticsEnabled()) {
mapService.getMapServiceContext().getLocalMapStatsProvider().getLocalMapStatsImpl(getDistributedObjectName()).incrementPuts(latency);
}
}
use of com.hazelcast.map.impl.MapService in project hazelcast by hazelcast.
the class MapAddInterceptorMessageTask method createOperationSupplier.
@Override
protected Supplier<Operation> createOperationSupplier() {
final MapService mapService = getService(MapService.SERVICE_NAME);
final MapServiceContext mapServiceContext = mapService.getMapServiceContext();
final MapInterceptor mapInterceptor = serializationService.toObject(parameters.interceptor);
id = mapServiceContext.generateInterceptorId(parameters.name, mapInterceptor);
return new AddInterceptorOperationSupplier(id, parameters.name, mapInterceptor);
}
Aggregations