logger.error(
"Failed to get a connection within the configured wait time because there are no available nodes. " +
"This possibly indicates that either the suspension strategy is too aggressive or that your " +
"cluster is in a bad way."
);
throw new NoConnectionsAvailableException("Failed to get a connection within the configured max wait time.");
}
if (connection == null) {
logger.error(
"Failed to get a connection within the maximum allowed wait time. " +
"Try increasing the either the number of allowed connections or the max wait time."
);
throw new NoConnectionsAvailableException("Failed to get a connection within the configured max wait time.");
}
logger.debug("Borrowing connection '{}'", connection);
statistics.connectionsActive.incrementAndGet();
reportConnectionBorrowed(connection.getNode().getAddress());