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>
Builder for
BucketedExecutorSettings-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbatchSize(int value) build()maxAttempts(int value) maxConcurrency(int value, ConcurrencyPolicy policy)
-
Constructor Details
-
Builder
public Builder(@Nonnull Function<T, String> bucketIdExtractor, @Nonnull BucketProcessor<T> processor) - Parameters:
bucketIdExtractor- the function used to group items in bucketsprocessor- the processor responsible for processing buckets of tasks
-
-
Method Details
-
batchSize
- Parameters:
value- the number of items from a bucket that should be processed in a singleBucketProcessorrun. The number of items that are passed to aBucketProcessoris guaranteed to be <= the configured batch size.- Returns:
this
-
build
-
maxAttempts
- Parameters:
value- the maximum number of times processing of a bucket should be attempted- Returns:
this
-
maxConcurrency
- 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
-