ClusterConnectionService service, Map<?, ?> props, int nodeId) {
ClusterConnection result = null;
try {
result = service.create(CLUSTER_CONNECT_STRING, nodeId);
result.connect(CLUSTER_CONNECT_RETRIES, CLUSTER_CONNECT_DELAY,true);
result.waitUntilReady(CLUSTER_CONNECT_TIMEOUT_BEFORE,CLUSTER_CONNECT_TIMEOUT_AFTER);
} catch (Exception ex) {
// need to clean up if some connections succeeded
for (ClusterConnection connection: pooledConnections) {
connection.close();
}