Created
September 19, 2014 11:22
-
-
Save gurbuzali/d3b99d796925dc5f7469 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.hazelcast.config.Config; | |
| import com.hazelcast.config.MapConfig; | |
| import com.hazelcast.config.MapStoreConfig; | |
| import com.hazelcast.core.Hazelcast; | |
| import com.hazelcast.core.HazelcastInstance; | |
| import com.hazelcast.core.IMap; | |
| import com.hazelcast.core.MapStore; | |
| import java.util.Collection; | |
| import java.util.HashSet; | |
| import java.util.Map; | |
| import java.util.Set; | |
| public class MapStoreDebug { | |
| public static void main(String[] args) { | |
| final Config config = new Config(); | |
| final MapStore<String, String> mapStore = new MapStore<String, String>() { | |
| @Override | |
| public void store(final String key, final String value) { | |
| } | |
| @Override | |
| public void storeAll(final Map<String, String> map) { | |
| } | |
| @Override | |
| public void delete(final String key) { | |
| } | |
| @Override | |
| public void deleteAll(final Collection<String> keys) { | |
| } | |
| @Override | |
| public String load(final String key) { | |
| return null; | |
| } | |
| @Override | |
| public Map<String, String> loadAll(final Collection<String> keys) { | |
| System.err.println("fatal loadAll"); | |
| return null; | |
| } | |
| @Override | |
| public Set<String> loadAllKeys() { | |
| System.err.println("fatal loadAllKeys"); | |
| final HashSet<String> keys = new HashSet<String>(); | |
| keys.add("key"); | |
| return keys; | |
| } | |
| }; | |
| final MapConfig mapConfig = config.getMapConfig("map"); | |
| final MapStoreConfig mapStoreConfig = new MapStoreConfig(); | |
| mapStoreConfig.setEnabled(true).setImplementation(mapStore); | |
| mapConfig.setMapStoreConfig(mapStoreConfig); | |
| final HazelcastInstance instance = Hazelcast.newHazelcastInstance(config); | |
| final IMap<Object, Object> map = instance.getMap("map"); | |
| map.size(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks. Will give it a try and see were the difference is....