@Override public <V, K extends Exception> V runWithRetryOnHost( InetSocketAddress specifiedHost, FunctionCheckedException<CassandraClient, V, K> fn) throws K { RetryableCassandraRequest<V, K> req = new RetryableCassandraRequest<>(specifiedHost, fn); while (true) { if (log.isTraceEnabled()) { log.trace("Running function on host {}.", SafeArg.of("host", CassandraLogHelper.host(req.getPreferredHost()))); } CassandraClientPoolingContainer hostPool = getPreferredHostOrFallBack(req); try { V response = runWithPooledResourceRecordingMetrics(hostPool, req.getFunction()); removeFromBlacklistAfterResponse(hostPool.getHost()); return response; } catch (Exception ex) { exceptionHandler.handleExceptionFromRequest(req, hostPool.getHost(), ex); } } }
@Override public <V, K extends Exception> V runWithRetryOnHost( InetSocketAddress specifiedHost, FunctionCheckedException<CassandraClient, V, K> fn) throws K { RetryableCassandraRequest<V, K> req = new RetryableCassandraRequest<>(specifiedHost, fn); while (true) { if (log.isTraceEnabled()) { log.trace("Running function on host {}.", SafeArg.of("host", CassandraLogHelper.host(req.getPreferredHost()))); } CassandraClientPoolingContainer hostPool = getPreferredHostOrFallBack(req); try { V response = runWithPooledResourceRecordingMetrics(hostPool, req.getFunction()); removeFromBlacklistAfterResponse(hostPool.getHost()); return response; } catch (Exception ex) { exceptionHandler.handleExceptionFromRequest(req, hostPool.getHost(), ex); } } }