Created
December 21, 2016 00:17
-
-
Save khaosans/0de924ddaf2a0fed9e9d456017c59f4c to your computer and use it in GitHub Desktop.
Put into the hazelcast cache
This file contains 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
public static void main(String[] args) throws InterruptedException { | |
ClientConfig clientConfig = new ClientConfig(); | |
List<String> addressList = new ArrayList<String>(); | |
addressList.add("localhost:5701"); | |
clientConfig.getNetworkConfig().setAddresses(addressList).setConnectionAttemptLimit(1000); | |
HazelcastInstance hazelcasetInstance = HazelcastClient.newHazelcastClient(clientConfig); | |
for (int i = 0; i < 10000; i++) { | |
IMap<String, String> map = hazelcasetInstance.getMap("map"); | |
System.out.println(i); | |
map.put(Integer.toString(i), "test"); | |
Thread.sleep(1000); | |
} | |
hazelcasetInstance.shutdown(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment