use of com.hazelcast.map.impl.proxy.MapProxyImpl in project hazelcast by hazelcast.
the class WanReplicationTest method getOperationProvider.
private MapOperationProvider getOperationProvider(Map map) {
MapProxyImpl mapProxy = (MapProxyImpl) map;
MapServiceContext mapServiceContext = ((MapService) mapProxy.getService()).getMapServiceContext();
return mapServiceContext.getMapOperationProvider(mapProxy.getName());
}
use of com.hazelcast.map.impl.proxy.MapProxyImpl in project hazelcast by hazelcast.
the class MapPartitionAwareService method onPartitionLost.
@Override
public void onPartitionLost(IPartitionLostEvent partitionLostEvent) {
final Address thisAddress = nodeEngine.getThisAddress();
final int partitionId = partitionLostEvent.getPartitionId();
Collection<DistributedObject> result = proxyService.getDistributedObjects(MapService.SERVICE_NAME);
for (DistributedObject object : result) {
final MapProxyImpl mapProxy = (MapProxyImpl) object;
final String mapName = mapProxy.getName();
if (mapProxy.getTotalBackupCount() <= partitionLostEvent.getLostReplicaIndex()) {
mapServiceContext.getMapEventPublisher().publishMapPartitionLostEvent(thisAddress, mapName, partitionId);
}
}
}
use of com.hazelcast.map.impl.proxy.MapProxyImpl 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.proxy.MapProxyImpl in project hazelcast by hazelcast.
the class PartitioningStrategyFactoryTest method setup.
@Before
public void setup() {
mapName = testName.getMethodName();
HazelcastInstance hazelcastInstance = createHazelcastInstance();
map = hazelcastInstance.getMap(mapName);
MapProxyImpl mapProxy = (MapProxyImpl) map;
MapService mapService = (MapService) mapProxy.getService();
MapServiceContextImpl mapServiceContext = (MapServiceContextImpl) mapService.getMapServiceContext();
partitioningStrategyFactory = mapServiceContext.partitioningStrategyFactory;
}
Aggregations