Class RetryPolicy.Builder

Enclosing class:
RetryPolicy

public static class RetryPolicy.Builder extends ValidatedBuilder<RetryPolicy>
  • Method Details

    • maxRetries

      public RetryPolicy.Builder maxRetries(int maxRetries)
      The maximum number of times a Task can be retried. The maximum total number of attempts will always be `maxRetries + 1` because the first attempt is not a retry. Must be 0 or higher. Zero is allowed if you want to be explicit, and to make it easy to change the number of retries without having to omit the policy. Specifying zero is effectively the same as having no RetryPolicy.
      Returns:
      this.
    • retryErrors

      public RetryPolicy.Builder retryErrors(Selection<TaskErrorSelector> retryErrors)
      Optional Selection which, if specified, only allows attempts matching the Selection to be retried. Note that it is only the TaskError from the most recent attempt that is evaluated by the Selection.
      Returns:
      this.
    • buildUnchecked

      public RetryPolicy buildUnchecked()
      Description copied from class: ValidatedBuilder
      Builds the object without enforcing validation constraints. This should only be used for testing purposes
      Overrides:
      buildUnchecked in class ValidatedBuilder<RetryPolicy>
      Returns:
      the object being built
    • toString

      public String toString()
      Overrides:
      toString in class Object