private long getMaxWaitTimeNanos() { if (settings.getServerSelectionTimeout(NANOSECONDS) < 0) { return Long.MAX_VALUE; } return settings.getServerSelectionTimeout(NANOSECONDS); }
private void logServerSelectionFailure(final ServerSelector serverSelector, final ClusterDescription curDescription) { if (LOGGER.isInfoEnabled()) { if (settings.getServerSelectionTimeout(MILLISECONDS) < 0) { LOGGER.info(format("No server chosen by %s from cluster description %s. Waiting indefinitely.", serverSelector, curDescription)); } else { LOGGER.info(format("No server chosen by %s from cluster description %s. Waiting for %d ms before timing out", serverSelector, curDescription, settings.getServerSelectionTimeout(MILLISECONDS))); } } }
private MongoTimeoutException createTimeoutException(final ServerSelector serverSelector, final ClusterDescription curDescription) { return new MongoTimeoutException(format("Timed out after %d ms while waiting for a server that matches %s. " + "Client view of cluster state is %s", settings.getServerSelectionTimeout(MILLISECONDS), serverSelector, curDescription.getShortDescription())); }
throw new MongoTimeoutException(format("Timed out after %d ms while waiting to connect. Client view of cluster state " + "is %s", settings.getServerSelectionTimeout(MILLISECONDS), curDescription.getShortDescription())); if (settings.getServerSelectionTimeout(MILLISECONDS) < 0) { LOGGER.info("Cluster description not yet available. Waiting indefinitely."); } else { LOGGER.info(format("Cluster description not yet available. Waiting for %d ms before timing out", settings.getServerSelectionTimeout(MILLISECONDS)));
private long getMaxWaitTimeNanos() { if (settings.getServerSelectionTimeout(NANOSECONDS) < 0) { return Long.MAX_VALUE; } return settings.getServerSelectionTimeout(NANOSECONDS); }
private void logServerSelectionFailure(final ServerSelector serverSelector, final ClusterDescription curDescription) { if (LOGGER.isInfoEnabled()) { if (settings.getServerSelectionTimeout(MILLISECONDS) < 0) { LOGGER.info(format("No server chosen by %s from cluster description %s. Waiting indefinitely.", serverSelector, curDescription)); } else { LOGGER.info(format("No server chosen by %s from cluster description %s. Waiting for %d ms before timing out", serverSelector, curDescription, settings.getServerSelectionTimeout(MILLISECONDS))); } } }
private MongoTimeoutException createTimeoutException(final ServerSelector serverSelector, final ClusterDescription curDescription) { return new MongoTimeoutException(format("Timed out after %d ms while waiting for a server that matches %s. " + "Client view of cluster state is %s", settings.getServerSelectionTimeout(MILLISECONDS), serverSelector, curDescription.getShortDescription())); }
throw new MongoTimeoutException(format("Timed out after %d ms while waiting to connect. Client view of cluster state " + "is %s", settings.getServerSelectionTimeout(MILLISECONDS), curDescription.getShortDescription())); if (settings.getServerSelectionTimeout(MILLISECONDS) < 0) { LOGGER.info("Cluster description not yet available. Waiting indefinitely."); } else { LOGGER.info(format("Cluster description not yet available. Waiting for %d ms before timing out", settings.getServerSelectionTimeout(MILLISECONDS)));