config.setProperty("hazelcast.logging.type", "log4j");
// disable JMX to make sure lazy loading works asynchronously
config.setProperty("hazelcast.jmx", "false");
// get map config
MapConfig mapConfig = config.getMapConfig(mapName);
// create shared map store implementation
// - use slow loading (300ms per map entry)
final CountDownLatch halfOfKeysAreLoaded = new CountDownLatch(1);
final InMemoryMapStore store = new InMemoryMapStore(msPerLoad, false, halfOfKeysAreLoaded);
store.preload(preloadSize);
// configure map store
MapStoreConfig mapStoreConfig = new MapStoreConfig();
mapStoreConfig.setEnabled(true);
mapStoreConfig.setInitialLoadMode(InitialLoadMode.LAZY);
mapStoreConfig.setWriteDelaySeconds(writeDelaySeconds);
mapStoreConfig.setClassName(null);
mapStoreConfig.setImplementation(store);
mapConfig.setMapStoreConfig(mapStoreConfig);
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
final CountDownLatch node1Started = new CountDownLatch(1);
final CountDownLatch node1FinishedLoading = new CountDownLatch(1);
// thread 1: