@Override public RetryDecision onRequestError( Statement statement, ConsistencyLevel cl, DriverException e, int nbRetry) { if (isIdempotent(statement)) return childPolicy.onRequestError(statement, cl, e, nbRetry); else return RetryDecision.rethrow(); }
protected void assertOnRequestErrorWasCalled( int times, Class<? extends DriverException> expected) { Mockito.verify(retryPolicy, times(times)) .onRequestError(any(Statement.class), any(ConsistencyLevel.class), any(expected), anyInt()); }
@Override public RetryDecision onRequestError( Statement statement, ConsistencyLevel cl, DriverException e, int nbRetry) { RetryDecision decision = policy.onRequestError(statement, cl, e, nbRetry); switch (decision.getType()) { case IGNORE: logDecision(IGNORING_REQUEST_ERROR, cl, nbRetry, e.toString()); break; case RETRY: logDecision( RETRYING_ON_REQUEST_ERROR, host(decision), cl(cl, decision), cl, nbRetry, e.toString()); break; } return decision; }
decision = retryPolicy() .onRequestError(statement, request().consistency(), exception, retriesByPolicy); } else { decision = RetryPolicy.RetryDecision.rethrow();
@Override public RetryDecision onRequestError(Statement statement, ConsistencyLevel cl, DriverException e, int nbRetry) { if (isIdempotent(statement)) return childPolicy.onRequestError(statement, cl, e, nbRetry); else return RetryDecision.rethrow(); }
@Override public RetryDecision onRequestError(Statement statement, ConsistencyLevel cl, DriverException e, int nbRetry) { if (isIdempotent(statement)) return childPolicy.onRequestError(statement, cl, e, nbRetry); else return RetryDecision.rethrow(); }
@Override public RetryDecision onRequestError(Statement statement, ConsistencyLevel cl, DriverException e, int nbRetry) { if (isIdempotent(statement)) return childPolicy.onRequestError(statement, cl, e, nbRetry); else return RetryDecision.rethrow(); }
protected void assertOnRequestErrorWasCalled( int times, Class<? extends DriverException> expected) { Mockito.verify(retryPolicy, times(times)) .onRequestError(any(Statement.class), any(ConsistencyLevel.class), any(expected), anyInt()); }
@Override public RetryDecision onRequestError(Statement statement, ConsistencyLevel cl, DriverException e, int nbRetry) { RetryDecision decision = policy.onRequestError(statement, cl, e, nbRetry); switch (decision.getType()) { case IGNORE: logDecision(IGNORING_REQUEST_ERROR, cl, nbRetry, e); break; case RETRY: logDecision(RETRYING_ON_REQUEST_ERROR, host(decision), cl(cl, decision), cl, nbRetry, e); break; } return decision; }
@Override public RetryDecision onRequestError(Statement statement, ConsistencyLevel cl, DriverException e, int nbRetry) { RetryDecision decision = policy.onRequestError(statement, cl, e, nbRetry); switch (decision.getType()) { case IGNORE: logDecision(IGNORING_REQUEST_ERROR, cl, nbRetry, e); break; case RETRY: logDecision(RETRYING_ON_REQUEST_ERROR, host(decision), cl(cl, decision), cl, nbRetry, e); break; } return decision; }
@Override public RetryDecision onRequestError(Statement statement, ConsistencyLevel cl, DriverException e, int nbRetry) { RetryDecision decision = policy.onRequestError(statement, cl, e, nbRetry); switch (decision.getType()) { case IGNORE: logDecision(IGNORING_REQUEST_ERROR, cl, nbRetry, e); break; case RETRY: logDecision(RETRYING_ON_REQUEST_ERROR, host(decision), cl(cl, decision), cl, nbRetry, e); break; } return decision; }
private RetryPolicy.RetryDecision computeRetryDecisionOnRequestError(DriverException exception) { RetryPolicy.RetryDecision decision; if (statement.isIdempotentWithDefault(manager.cluster.getConfiguration().getQueryOptions())) { decision = retryPolicy().onRequestError(statement, request().consistency(), exception, retriesByPolicy); } else { decision = RetryPolicy.RetryDecision.rethrow(); } if (metricsEnabled()) { if (exception instanceof OperationTimedOutException) { metrics().getErrorMetrics().getClientTimeouts().inc(); if (decision.getType() == Type.RETRY) metrics().getErrorMetrics().getRetriesOnClientTimeout().inc(); if (decision.getType() == Type.IGNORE) metrics().getErrorMetrics().getIgnoresOnClientTimeout().inc(); } else if (exception instanceof ConnectionException) { metrics().getErrorMetrics().getConnectionErrors().inc(); if (decision.getType() == Type.RETRY) metrics().getErrorMetrics().getRetriesOnConnectionError().inc(); if (decision.getType() == Type.IGNORE) metrics().getErrorMetrics().getIgnoresOnConnectionError().inc(); } else { metrics().getErrorMetrics().getOthers().inc(); if (decision.getType() == Type.RETRY) metrics().getErrorMetrics().getRetriesOnOtherErrors().inc(); if (decision.getType() == Type.IGNORE) metrics().getErrorMetrics().getIgnoresOnOtherErrors().inc(); } } return decision; }
private RetryPolicy.RetryDecision computeRetryDecisionOnRequestError(DriverException exception) { RetryPolicy.RetryDecision decision; if (statement.isIdempotentWithDefault(manager.cluster.getConfiguration().getQueryOptions())) { decision = retryPolicy().onRequestError(statement, request().consistency(), exception, retriesByPolicy); } else { logIdempotenceWarning();
private RetryPolicy.RetryDecision computeRetryDecisionOnRequestError(DriverException exception) { RetryPolicy.RetryDecision decision; if (statement.isIdempotentWithDefault(manager.cluster.getConfiguration().getQueryOptions())) { decision = retryPolicy().onRequestError(statement, request().consistency(), exception, retriesByPolicy); } else { logIdempotenceWarning();