}
public static void main(String[] args) throws InterruptedException {
Config config = new Config();
config.setGroupConfig(new GroupConfig("test", "test"));
config.getNetworkConfig().setPort(6701);
HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(config);
IMap<Integer, GenericEvent> map = hazelcastInstance.getMap("test");
map.addIndex("userId", false);
Hazelcast.newHazelcastInstance(config);
ClientConfig clientConfig = new ClientConfig();
clientConfig.getNetworkConfig().addAddress("localhost:6701", "localhost:6702");
clientConfig.setGroupConfig(new GroupConfig("test", "test"));
clientConfig.getNetworkConfig().setConnectionAttemptLimit(100);
clientConfig.getNetworkConfig().setSmartRouting(false);
HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
IMap<Integer, GenericEvent> mapClient = client.getMap("test");