@SuppressWarnings("unchecked") <K extends Exception> void handleExceptionFromRequest( RetryableCassandraRequest<?, K> req, InetSocketAddress hostTried, Exception ex) throws K { if (!isRetryable(ex)) { throw (K) ex; } RequestExceptionHandlerStrategy strategy = getStrategy(); req.triedOnHost(hostTried); req.registerException(ex); int numberOfAttempts = req.getNumberOfAttempts(); int numberOfAttemptsOnHost = req.getNumberOfAttemptsOnHost(hostTried); if (numberOfAttempts >= maxTriesTotal.get()) { throw logAndThrowException(numberOfAttempts, ex, req); } if (shouldBlacklist(ex, numberOfAttemptsOnHost)) { blacklist.add(hostTried); } logNumberOfAttempts(ex, numberOfAttempts); handleBackoff(req, hostTried, ex, strategy); handleRetryOnDifferentHosts(req, hostTried, ex, strategy); }
@SuppressWarnings("unchecked") <K extends Exception> void handleExceptionFromRequest( RetryableCassandraRequest<?, K> req, InetSocketAddress hostTried, Exception ex) throws K { if (!isRetryable(ex)) { throw (K) ex; } RequestExceptionHandlerStrategy strategy = getStrategy(); req.triedOnHost(hostTried); req.registerException(ex); int numberOfAttempts = req.getNumberOfAttempts(); int numberOfAttemptsOnHost = req.getNumberOfAttemptsOnHost(hostTried); if (numberOfAttempts >= maxTriesTotal.get()) { throw logAndThrowException(numberOfAttempts, ex, req); } if (shouldBlacklist(ex, numberOfAttemptsOnHost)) { blacklist.add(hostTried); } logNumberOfAttempts(ex, numberOfAttempts); handleBackoff(req, hostTried, ex, strategy); handleRetryOnDifferentHosts(req, hostTried, ex, strategy); }