Class BucketedExecutorSettings.Builder<T extends Serializable>

java.lang.Object
com.atlassian.bitbucket.concurrent.BucketedExecutorSettings.Builder<T>
Type Parameters:
T - the task type
Enclosing class:
BucketedExecutorSettings<T extends Serializable>

public static class BucketedExecutorSettings.Builder<T extends Serializable> extends Object
  • Constructor Details

    • Builder

      public Builder(@Nonnull Function<T,String> bucketIdExtractor, @Nonnull BucketProcessor<T> processor)
      Parameters:
      bucketIdExtractor - the function used to group items in buckets
      processor - the processor responsible for processing buckets of tasks
  • Method Details

    • batchSize

      public BucketedExecutorSettings.Builder<T> batchSize(int value)
      Parameters:
      value - the number of items from a bucket that should be processed in a single BucketProcessor run. The number of items that are passed to a BucketProcessor is guaranteed to be <= the configured batch size.
      Returns:
      this
    • build

      public BucketedExecutorSettings<T> build()
    • maxAttempts

      public BucketedExecutorSettings.Builder<T> maxAttempts(int value)
      Parameters:
      value - the maximum number of times processing of a bucket should be attempted
      Returns:
      this
    • maxConcurrency

      public BucketedExecutorSettings.Builder<T> maxConcurrency(int value, ConcurrencyPolicy policy)
      Parameters:
      value - the maximum number of different buckets that can be concurrently processed. In a clustered instance, this maximum is translated into a per-node maximum by dividing the maximum by the number of nodes in the cluster (rounded up).
      policy - the concurrency policy
      Returns:
      this