public Boolean call() { logger.debug("Adding {} to list of queried hosts", host); try { HostConnectionPool previous = pools.put(host, new HostConnectionPool(host, distance, SessionManager.this)); if (previous != null) previous.closeAsync(); // The previous was probably already shutdown but that's ok return true; } catch (AuthenticationException e) { logger.error("Error creating pool to {} ({})", host, e.getMessage()); cluster.manager.signalConnectionFailure(host, new ConnectionException(e.getAddress(), e.getMessage()), isHostAddition); return false; } catch (UnsupportedProtocolVersionException e) { logger.error("Error creating pool to {} ({})", host, e.getMessage()); cluster.manager.signalConnectionFailure(host, new ConnectionException(e.address, e.getMessage()), isHostAddition); return false; } catch (ConnectionException e) { logger.debug("Error creating pool to {} ({})", host, e.getMessage()); cluster.manager.signalConnectionFailure(host, e, isHostAddition); return false; } } });