/* * Test for Issue 572 */ @Test(timeout = 120000) public void testMapstoreDeleteOnClear() throws Exception { Config config = getConfig(); SimpleMapStore store = new SimpleMapStore(); config .getMapConfig("testMapstoreDeleteOnClear") .setMapStoreConfig(new MapStoreConfig().setEnabled(true).setImplementation(store)); HazelcastInstance hz = createHazelcastInstance(config); IMap<Object, Object> map = hz.getMap("testMapstoreDeleteOnClear"); int size = 10; for (int i = 0; i < size; i++) { map.put(i, i); } assertEquals(size, map.size()); assertEquals(size, store.store.size()); assertEquals(size, store.loadAllKeys().size()); map.clear(); assertEquals(0, map.size()); assertEquals(0, store.loadAllKeys().size()); }
@Override public void storeAll(Map map) { if (sleepStoreAllSeconds > 0) { try { Thread.sleep(sleepStoreAllSeconds * 1000); } catch (InterruptedException e) { } } for (Object o : map.keySet()) { latch.countDown(); count.incrementAndGet(); } super.storeAll(map); }
public void delete(String key) { deleteCount.incrementAndGet(); super.delete(key); }
public void store(String key, Long value) { storeCount.incrementAndGet(); super.store(key, value); }
@Override public void store(Object key, Object value) { latch.countDown(); super.store(key, value); count.incrementAndGet(); }