@Test public void connectionExceptionsWithSufficientAttemptsShouldBlacklistDefault() { for (Exception ex : CONNECTION_EXCEPTIONS) { assertFalse("MAX_RETRIES_PER_HOST - 1 attempts should not blacklist", handlerLegacy.shouldBlacklist(ex, MAX_RETRIES_PER_HOST - 1)); } for (Exception ex : CONNECTION_EXCEPTIONS) { assertTrue(String.format("MAX_RETRIES_PER_HOST attempts with exception %s should blacklist", ex), handlerLegacy.shouldBlacklist(ex, MAX_RETRIES_PER_HOST)); } Exception ffException = Iterables.get(FAST_FAILOVER_EXCEPTIONS, 0); assertFalse(String.format("Exception %s should not blacklist", ffException), handlerLegacy.shouldBlacklist(ffException, MAX_RETRIES_PER_HOST)); }
@VisibleForTesting boolean shouldBlacklist(Exception ex, int numberOfAttempts) { return isConnectionException(ex) && numberOfAttempts >= maxTriesSameHost.get() && !isExceptionNotImplicatingThisParticularNode(ex); }
CassandraRequestExceptionHandler { @VisibleForTesting boolean shouldBlacklist(Exception ex, int numberOfAttempts) { return isConnectionException(ex) && numberOfAttempts >= maxTriesSameHost.get() && !isExceptionNotImplicatingThisParticularNode(ex); } }
CassandraRequestExceptionHandler { @VisibleForTesting boolean shouldBlacklist(Exception ex, int numberOfAttempts) { return isConnectionException(ex) && numberOfAttempts >= maxTriesSameHost.get() && !isExceptionNotImplicatingThisParticularNode(ex); } CassandraRequestExceptionHandler(
            Supplier<Integer> maxTriesSameHost,
            Supplier<Integer> maxTriesTotal,
            Supplier<Boolean> useConservativeHandler,
            Blacklist blacklist); private  CassandraRequestExceptionHandler(
            Supplier<Integer> maxTriesSameHost,
            Supplier<Integer> maxTriesTotal,
            Blacklist blacklist); }
CassandraRequestExceptionHandler { @VisibleForTesting boolean shouldBlacklist(Exception ex, int numberOfAttempts) { return isConnectionException(ex) && numberOfAttempts >= maxTriesSameHost.get() && !isExceptionNotImplicatingThisParticularNode(ex); } CassandraRequestExceptionHandler(
            Supplier<Integer> maxTriesSameHost,
            Supplier<Integer> maxTriesTotal,
            Supplier<Boolean> useConservativeHandler,
            Blacklist blacklist); private  CassandraRequestExceptionHandler(
            Supplier<Integer> maxTriesSameHost,
            Supplier<Integer> maxTriesTotal,
            Blacklist blacklist);  }
CassandraRequestExceptionHandler { @VisibleForTesting boolean shouldBlacklist(Exception ex, int numberOfAttempts) { return isConnectionException(ex) && numberOfAttempts >= maxTriesSameHost.get() && !isExceptionNotImplicatingThisParticularNode(ex); } CassandraRequestExceptionHandler(
            Supplier<Integer> maxTriesSameHost,
            Supplier<Integer> maxTriesTotal,
            Supplier<Boolean> useConservativeHandler,
            Blacklist blacklist); private  CassandraRequestExceptionHandler(
            Supplier<Integer> maxTriesSameHost,
            Supplier<Integer> maxTriesTotal,
            Blacklist blacklist);   }