@Override protected boolean onConnectionException(ConnectionException e, long nextDelayMs) { if (logger.isDebugEnabled()) logger.debug( "Failed reconnection to {} ({}), scheduling retry in {} milliseconds", host, e.getMessage(), nextDelayMs); return true; }
@Override protected boolean onConnectionException(ConnectionException e, long nextDelayMs) { if (logger.isDebugEnabled()) logger.debug("Failed one-time reconnection to {} ({})", host, e.getMessage()); return false; }
/** @jira_ticket JAVA-1139 */ @Test(groups = "unit") public void getMessage_should_return_message_if_address_is_null() { assertEquals(new ConnectionException(null, "Test message").getMessage(), "Test message"); }
/** @jira_ticket JAVA-1139 */ @Test(groups = "unit") public void getMessage_should_return_message_if_address_is_resolved() { assertEquals( new ConnectionException(new InetSocketAddress("127.0.0.1", 9042), "Test message") .getMessage(), "[/127.0.0.1:9042] Test message"); } }
void refreshNodeListAndTokenMap() { Connection c = connectionRef.get(); // At startup, when we add the initial nodes, this will be null, which is ok if (c == null || c.isClosed()) return; try { refreshNodeListAndTokenMap(c, cluster, false, true); } catch (ConnectionException e) { logger.debug( "[Control connection] Connection error while refreshing node list and token map ({})", e.getMessage()); signalError(); } catch (ExecutionException e) { // If we're being shutdown during refresh, this can happen. That's fine so don't scare the // user. if (!isShutdown) logger.error( "[Control connection] Unexpected error while refreshing node list and token map", e); signalError(); } catch (BusyConnectionException e) { logger.debug("[Control connection] Connection is busy, reconnecting"); signalError(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); logger.debug( "[Control connection] Interrupted while refreshing node list and token map, skipping it."); } }
/** @jira_ticket JAVA-1139 */ @Test(groups = "unit") public void getMessage_should_return_message_if_address_is_unresolved() { assertEquals( new ConnectionException( InetSocketAddress.createUnresolved("127.0.0.1", 9042), "Test message") .getMessage(), "[127.0.0.1:9042] Test message"); }
public void refreshSchema( SchemaElement targetType, String targetKeyspace, String targetName, List<String> signature) throws InterruptedException { logger.debug( "[Control connection] Refreshing schema for {}{}", targetType == null ? "everything" : targetKeyspace, (targetType == KEYSPACE) ? "" : "." + targetName + " (" + targetType + ")"); try { Connection c = connectionRef.get(); // At startup, when we add the initial nodes, this will be null, which is ok if (c == null || c.isClosed()) return; refreshSchema(c, targetType, targetKeyspace, targetName, signature, cluster); } catch (ConnectionException e) { logger.debug( "[Control connection] Connection error while refreshing schema ({})", e.getMessage()); signalError(); } catch (ExecutionException e) { // If we're being shutdown during schema refresh, this can happen. That's fine so don't scare // the user. if (!isShutdown) logger.error("[Control connection] Unexpected error while refreshing schema", e); signalError(); } catch (BusyConnectionException e) { logger.debug("[Control connection] Connection is busy, reconnecting"); signalError(); } }
"[Control connection] Connection error while refreshing node info ({})", e.getMessage()); signalError(); } catch (ExecutionException e) {
@Override protected boolean onConnectionException(ConnectionException e, long nextDelayMs) { if (logger.isDebugEnabled()) logger.debug("Failed one-time reconnection to {} ({})", host, e.getMessage()); return false; }
@Override protected boolean onConnectionException(ConnectionException e, long nextDelayMs) { if (logger.isDebugEnabled()) logger.debug("Failed one-time reconnection to {} ({})", host, e.getMessage()); return false; }
@Override protected boolean onConnectionException(ConnectionException e, long nextDelayMs) { if (logger.isDebugEnabled()) logger.debug("Failed reconnection to {} ({}), scheduling retry in {} milliseconds", host, e.getMessage(), nextDelayMs); return true; }
@Override protected boolean onConnectionException(ConnectionException e, long nextDelayMs) { if (logger.isDebugEnabled()) logger.debug("Failed reconnection to {} ({}), scheduling retry in {} milliseconds", host, e.getMessage(), nextDelayMs); return true; }
@Override protected boolean onConnectionException(ConnectionException e, long nextDelayMs) { if (logger.isDebugEnabled()) logger.debug("Failed reconnection to {} ({}), scheduling retry in {} milliseconds", host, e.getMessage(), nextDelayMs); return true; }
@Override protected boolean onConnectionException(ConnectionException e, long nextDelayMs) { if (logger.isDebugEnabled()) logger.debug("Failed one-time reconnection to {} ({})", host, e.getMessage()); return false; }
/** @jira_ticket JAVA-1139 */ @Test(groups = "unit") public void getMessage_should_return_message_if_address_is_unresolved() { assertEquals( new ConnectionException( InetSocketAddress.createUnresolved("127.0.0.1", 9042), "Test message") .getMessage(), "[127.0.0.1:9042] Test message"); }
public void refreshSchema(SchemaElement targetType, String targetKeyspace, String targetName, List<String> signature) throws InterruptedException { logger.debug("[Control connection] Refreshing schema for {}{}", targetType == null ? "everything" : targetKeyspace, (targetType == KEYSPACE) ? "" : "." + targetName + " (" + targetType + ")"); try { Connection c = connectionRef.get(); // At startup, when we add the initial nodes, this will be null, which is ok if (c == null || c.isClosed()) return; refreshSchema(c, targetType, targetKeyspace, targetName, signature, cluster); } catch (ConnectionException e) { logger.debug("[Control connection] Connection error while refreshing schema ({})", e.getMessage()); signalError(); } catch (ExecutionException e) { // If we're being shutdown during schema refresh, this can happen. That's fine so don't scare the user. if (!isShutdown) logger.error("[Control connection] Unexpected error while refreshing schema", e); signalError(); } catch (BusyConnectionException e) { logger.debug("[Control connection] Connection is busy, reconnecting"); signalError(); } }
public void refreshSchema(SchemaElement targetType, String targetKeyspace, String targetName, List<String> signature) throws InterruptedException { logger.debug("[Control connection] Refreshing schema for {}{}", targetType == null ? "everything" : targetKeyspace, (targetType == KEYSPACE) ? "" : "." + targetName + " (" + targetType + ")"); try { Connection c = connectionRef.get(); // At startup, when we add the initial nodes, this will be null, which is ok if (c == null || c.isClosed()) return; refreshSchema(c, targetType, targetKeyspace, targetName, signature, cluster); } catch (ConnectionException e) { logger.debug("[Control connection] Connection error while refreshing schema ({})", e.getMessage()); signalError(); } catch (ExecutionException e) { // If we're being shutdown during schema refresh, this can happen. That's fine so don't scare the user. if (!isShutdown) logger.error("[Control connection] Unexpected error while refreshing schema", e); signalError(); } catch (BusyConnectionException e) { logger.debug("[Control connection] Connection is busy, reconnecting"); signalError(); } }
/** @jira_ticket JAVA-1139 */ @Test(groups = "unit") public void getMessage_should_return_message_if_address_is_null() { assertEquals(new ConnectionException(null, "Test message").getMessage(), "Test message"); }
/** @jira_ticket JAVA-1139 */ @Test(groups = "unit") public void getMessage_should_return_message_if_address_is_resolved() { assertEquals( new ConnectionException(new InetSocketAddress("127.0.0.1", 9042), "Test message") .getMessage(), "[/127.0.0.1:9042] Test message"); } }
public void refreshSchema(SchemaElement targetType, String targetKeyspace, String targetName, List<String> signature) throws InterruptedException { logger.debug("[Control connection] Refreshing schema for {}{}", targetType == null ? "everything" : targetKeyspace, (targetType == KEYSPACE) ? "" : "." + targetName + " (" + targetType + ")"); try { Connection c = connectionRef.get(); // At startup, when we add the initial nodes, this will be null, which is ok if (c == null || c.isClosed()) return; refreshSchema(c, targetType, targetKeyspace, targetName, signature, cluster); } catch (ConnectionException e) { logger.debug("[Control connection] Connection error while refreshing schema ({})", e.getMessage()); signalError(); } catch (ExecutionException e) { // If we're being shutdown during schema refresh, this can happen. That's fine so don't scare the user. if (!isShutdown) logger.error("[Control connection] Unexpected error while refreshing schema", e); signalError(); } catch (BusyConnectionException e) { logger.debug("[Control connection] Connection is busy, reconnecting"); signalError(); } }