Package org.nuxeo.lib.stream.computation
Class ComputationPolicyBuilder
java.lang.Object
org.nuxeo.lib.stream.computation.ComputationPolicyBuilder
Builder to create a ComputationPolicy.
- Since:
- 10.3
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbatchPolicy
(int capacity, Duration timeThreshold) Defines how to group records by batch using a capacity and a time threshold.build()
Creates the policy.continueOnFailure
(boolean value) The fallback when processing a batch has failed after applying the retry policy has failed.retryPolicy
(net.jodah.failsafe.RetryPolicy<Object> policy) Defines what to do in case of failure during the batch processing.skipFirstFailures
(int failures) A recovery fallback that continues processing after failure only for a limited number of time.
-
Field Details
-
DEFAULT_BATCH_CAPACITY
protected static final int DEFAULT_BATCH_CAPACITY- See Also:
-
DEFAULT_BATCH_THRESHOLD_SECOND
protected static final int DEFAULT_BATCH_THRESHOLD_SECOND- See Also:
-
retryPolicy
-
skipFailure
protected boolean skipFailure -
skipFirstFailures
protected int skipFirstFailures -
batchCapacity
protected int batchCapacity -
batchThreshold
-
-
Constructor Details
-
ComputationPolicyBuilder
public ComputationPolicyBuilder()
-
-
Method Details
-
batchPolicy
Defines how to group records by batch using a capacity and a time threshold.This is used only by computation that extends AbstractBatchComputation.
- Parameters:
capacity
- the number of records in the batchtimeThreshold
- process the batch even if not full after this duration
-
retryPolicy
Defines what to do in case of failure during the batch processing. -
continueOnFailure
The fallback when processing a batch has failed after applying the retry policy has failed.- Parameters:
value
- Whentrue
Skips the records affected by the batch in failure and continue.When
false
aborts the computation, this is the default behavior.
-
skipFirstFailures
A recovery fallback that continues processing after failure only for a limited number of time.- Since:
- 11.1
-
build
Creates the policy.
-