Created
February 20, 2014 12:25
-
-
Save gurbuzali/9112383 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
| public class ClientProcess { | |
| public static void main(String[] args) { | |
| final ClientConfig clientConfig = new ClientConfig(); | |
| clientConfig.setConnectionPoolSize(Integer.valueOf(args[0])); | |
| final HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig); | |
| final IMap<Object,Object> map = client.getMap("map"); | |
| final Random random = new Random(System.currentTimeMillis()); | |
| final byte[] bytes = new byte[100]; | |
| int threadCount = Integer.valueOf(args[1]); | |
| for (int i=0; i<threadCount; i++){ | |
| final Thread thread = new Thread(){ | |
| public void run() { | |
| while (true) { | |
| map.set(random.nextInt(1000), bytes); | |
| } | |
| } | |
| }; | |
| thread.setDaemon(true); | |
| thread.start(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment