* @throws IOException
*/
private ClientImpl createClientAndConnect() throws UnknownHostException, IOException
{
// Make client connections.
ClientImpl clientTmp = (ClientImpl) ClientFactory.createClient(this.config);
// ENG-6231: Only fail if we can't connect to any of the provided servers.
boolean connectedAnything = false;
for (String server : this.servers) {
try {
clientTmp.createConnection(server);
connectedAnything = true;
}
catch (UnknownHostException e) {
}
catch (IOException e) {
}
}
if (!connectedAnything) {
try {
clientTmp.close();
} catch (InterruptedException ie) {}
throw new IOException("Unable to connect to VoltDB cluster with servers: " + this.servers);
}
this.client.set(clientTmp);