public static class

BucketedExecutorSettings.Builder

extends Object
java.lang.Object
   ↳ com.atlassian.bitbucket.concurrent.BucketedExecutorSettings.Builder<T extends java.io.Serializable>

Class Overview

Builder for BucketedExecutorSettings

Summary

Public Constructors
Builder(Function<T, String> bucketIdExtractor, BucketProcessor<T> processor)
Public Methods
Builder<T> batchSize(int value)
BucketedExecutorSettings<T> build()
Builder<T> maxAttempts(int value)
Builder<T> maxConcurrency(int value, ConcurrencyPolicy policy)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder (Function<T, String> bucketIdExtractor, BucketProcessor<T> processor)

Parameters
bucketIdExtractor the function used to group items in buckets
processor the processor responsible for processing buckets of tasks

Public Methods

public 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
  • the builder

public BucketedExecutorSettings<T> build ()

public Builder<T> maxAttempts (int value)

Parameters
value the maximum number of times processing of a bucket should be attempted
Returns
  • the builder

public 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).
Returns
  • the builder