import com.hazelcast.client.HazelcastClient; import com.hazelcast.client.config.ClientConfig; import com.hazelcast.core.HazelcastInstance; import com.hazelcast.core.IMap; import java.util.concurrent.BlockingQueue; public class Client { public static void main(String[] args) throws Exception { ClientConfig clientConfig = new ClientConfig(); clientConfig.getNetworkConfig().addAddress("127.0.0.1:5701"); HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig); System.out.println(clientConfig.toString()); IMap map = client.getMap("myIntMap"); String key = "key01"; byte[] cnt = new byte[1]; for (int i = 0; i != 25; ++i) { for (int j = 0; j != cnt.length; ++j) cnt[j] = (byte) (j%250); long tm = System.currentTimeMillis(); map.set("key232", cnt); long tm2 = System.currentTimeMillis(); map.get("key232"); long tm3 = System.currentTimeMillis(); System.out.format("%d, %d, %f, %d, %f MBytes/Sec\n", cnt.length, (tm2 - tm), 0.001*cnt.length/(tm2 - tm), (tm3 - tm2), 0.001*cnt.length/(tm3 - tm2)); cnt = new byte[cnt.length*2]; } HazelcastClient.shutdownAll(); } }