/** * Creates a {@link RetryDecision.Type#RETRY} retry decision using * the same host and the provided consistency level. * <p/> * If the provided consistency level is {@code null}, the retry will be done at the same consistency level as * the previous attempt. * <p/> * Beware that {@link ConsistencyLevel#isSerial() serial} consistency levels * should never be passed to this method; attempting to do so would trigger an * {@link com.datastax.driver.core.exceptions.InvalidQueryException InvalidQueryException}. * * @param consistency the consistency level to use for the retry; if {@code null}, * the same level as the previous attempt will be used. * @return a {@link RetryDecision.Type#RETRY} decision using * the same host and the provided consistency level */ public static RetryDecision retry(ConsistencyLevel consistency) { return new RetryDecision(Type.RETRY, consistency, true); }
/** * Creates a {@link RetryDecision.Type#RETRY} retry decision using * the same host and the provided consistency level. * <p/> * If the provided consistency level is {@code null}, the retry will be done at the same consistency level as * the previous attempt. * <p/> * Beware that {@link ConsistencyLevel#isSerial() serial} consistency levels * should never be passed to this method; attempting to do so would trigger an * {@link com.datastax.driver.core.exceptions.InvalidQueryException InvalidQueryException}. * * @param consistency the consistency level to use for the retry; if {@code null}, * the same level as the previous attempt will be used. * @return a {@link RetryDecision.Type#RETRY} decision using * the same host and the provided consistency level */ public static RetryDecision retry(ConsistencyLevel consistency) { return new RetryDecision(Type.RETRY, consistency, true); }
/** * Creates a {@link RetryDecision.Type#RETRY} retry decision using the next host * in the query plan, and using the provided consistency level. * <p/> * If the provided consistency level is {@code null}, the retry will be done at the same consistency level as * the previous attempt. * <p/> * Beware that {@link ConsistencyLevel#isSerial() serial} consistency levels * should never be passed to this method; attempting to do so would trigger an * {@link com.datastax.driver.core.exceptions.InvalidQueryException InvalidQueryException}. * * @param consistency the consistency level to use for the retry; if {@code null}, * the same level as the previous attempt will be used. * @return a {@link RetryDecision.Type#RETRY} retry decision using the next host * in the query plan, and using the provided consistency level. */ public static RetryDecision tryNextHost(ConsistencyLevel consistency) { return new RetryDecision(Type.RETRY, consistency, false); }
/** * Creates a {@link RetryDecision.Type#RETRY} retry decision using the next host * in the query plan, and using the provided consistency level. * <p/> * If the provided consistency level is {@code null}, the retry will be done at the same consistency level as * the previous attempt. * <p/> * Beware that {@link ConsistencyLevel#isSerial() serial} consistency levels * should never be passed to this method; attempting to do so would trigger an * {@link com.datastax.driver.core.exceptions.InvalidQueryException InvalidQueryException}. * * @param consistency the consistency level to use for the retry; if {@code null}, * the same level as the previous attempt will be used. * @return a {@link RetryDecision.Type#RETRY} retry decision using the next host * in the query plan, and using the provided consistency level. */ public static RetryDecision tryNextHost(ConsistencyLevel consistency) { return new RetryDecision(Type.RETRY, consistency, false); }
/** * Creates a {@link RetryDecision.Type#RETRY} retry decision using * the same host and the provided consistency level. * <p/> * If the provided consistency level is {@code null}, the retry will be done at the same consistency level as * the previous attempt. * <p/> * Beware that {@link ConsistencyLevel#isSerial() serial} consistency levels * should never be passed to this method; attempting to do so would trigger an * {@link com.datastax.driver.core.exceptions.InvalidQueryException InvalidQueryException}. * * @param consistency the consistency level to use for the retry; if {@code null}, * the same level as the previous attempt will be used. * @return a {@link RetryDecision.Type#RETRY} decision using * the same host and the provided consistency level */ public static RetryDecision retry(ConsistencyLevel consistency) { return new RetryDecision(Type.RETRY, consistency, true); }
/** * Creates a {@link RetryDecision.Type#RETRY} retry decision using the next host * in the query plan, and using the provided consistency level. * <p/> * If the provided consistency level is {@code null}, the retry will be done at the same consistency level as * the previous attempt. * <p/> * Beware that {@link ConsistencyLevel#isSerial() serial} consistency levels * should never be passed to this method; attempting to do so would trigger an * {@link com.datastax.driver.core.exceptions.InvalidQueryException InvalidQueryException}. * * @param consistency the consistency level to use for the retry; if {@code null}, * the same level as the previous attempt will be used. * @return a {@link RetryDecision.Type#RETRY} retry decision using the next host * in the query plan, and using the provided consistency level. */ public static RetryDecision tryNextHost(ConsistencyLevel consistency) { return new RetryDecision(Type.RETRY, consistency, false); }
/** * Creates a RETHROW retry decision. * * @return a RETHROW retry decision. */ public static RetryDecision rethrow() { return new RetryDecision(Type.RETHROW, null); }
/** * Creates an IGNORE retry decision. * * @return an IGNORE retry decision. */ public static RetryDecision ignore() { return new RetryDecision(Type.IGNORE, null); }
/** * Creates a RETRY retry decision using the provided consistency level. * * @param consistency the consistency level to use for the retry. * @return a RETRY with consistency level {@code consistency} retry decision. */ public static RetryDecision retry(ConsistencyLevel consistency) { return new RetryDecision(Type.RETRY, consistency); }
/** * Creates a {@link RetryDecision.Type#RETRY} retry decision using the next host in the query * plan, and using the provided consistency level. * * <p>If the provided consistency level is {@code null}, the retry will be done at the same * consistency level as the previous attempt. * * <p>Beware that {@link ConsistencyLevel#isSerial() serial} consistency levels should never be * passed to this method; attempting to do so would trigger an {@link * com.datastax.driver.core.exceptions.InvalidQueryException InvalidQueryException}. * * @param consistency the consistency level to use for the retry; if {@code null}, the same * level as the previous attempt will be used. * @return a {@link RetryDecision.Type#RETRY} retry decision using the next host in the query * plan, and using the provided consistency level. */ public static RetryDecision tryNextHost(ConsistencyLevel consistency) { return new RetryDecision(Type.RETRY, consistency, false); }
/** * Creates a {@link RetryDecision.Type#RETRY} retry decision using the same host and the * provided consistency level. * * <p>If the provided consistency level is {@code null}, the retry will be done at the same * consistency level as the previous attempt. * * <p>Beware that {@link ConsistencyLevel#isSerial() serial} consistency levels should never be * passed to this method; attempting to do so would trigger an {@link * com.datastax.driver.core.exceptions.InvalidQueryException InvalidQueryException}. * * @param consistency the consistency level to use for the retry; if {@code null}, the same * level as the previous attempt will be used. * @return a {@link RetryDecision.Type#RETRY} decision using the same host and the provided * consistency level */ public static RetryDecision retry(ConsistencyLevel consistency) { return new RetryDecision(Type.RETRY, consistency, true); }