Record Class CompletionConfig
java.lang.Object
java.lang.Record
software.amazon.lambda.durable.config.CompletionConfig
public record CompletionConfig(Integer minSuccessful, Integer toleratedFailureCount, Double toleratedFailurePercentage)
extends Record
Controls when a concurrent operation (map or parallel) completes.
Provides factory methods for common completion strategies and fine-grained control via minSuccessful,
toleratedFailureCount, and toleratedFailurePercentage.
-
Constructor Summary
ConstructorsConstructorDescriptionCompletionConfig(Integer minSuccessful, Integer toleratedFailureCount, Double toleratedFailurePercentage) Creates an instance of aCompletionConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic CompletionConfigAll items run regardless of failures.static CompletionConfigAll items must succeed.final booleanIndicates whether some other object is "equal to" this one.static CompletionConfigComplete as soon as the first item succeeds.final inthashCode()Returns a hash code value for this object.Returns the value of theminSuccessfulrecord component.static CompletionConfigminSuccessful(int count) Complete when the specified number of items have succeeded.Returns the value of thetoleratedFailureCountrecord component.static CompletionConfigtoleratedFailureCount(int count) Complete when more than the specified number of failures have occurred.Returns the value of thetoleratedFailurePercentagerecord component.static CompletionConfigtoleratedFailurePercentage(double percentage) Complete when the failure percentage exceeds the specified threshold (0.0 to 1.0).final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CompletionConfig
public CompletionConfig(Integer minSuccessful, Integer toleratedFailureCount, Double toleratedFailurePercentage) Creates an instance of aCompletionConfigrecord class.- Parameters:
minSuccessful- the value for theminSuccessfulrecord componenttoleratedFailureCount- the value for thetoleratedFailureCountrecord componenttoleratedFailurePercentage- the value for thetoleratedFailurePercentagerecord component
-
-
Method Details
-
allSuccessful
All items must succeed. Zero failures tolerated. -
allCompleted
All items run regardless of failures. Failures captured per-item. -
firstSuccessful
Complete as soon as the first item succeeds. -
minSuccessful
Complete when the specified number of items have succeeded. -
toleratedFailureCount
Complete when more than the specified number of failures have occurred. -
toleratedFailurePercentage
Complete when the failure percentage exceeds the specified threshold (0.0 to 1.0). -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
minSuccessful
Returns the value of theminSuccessfulrecord component.- Returns:
- the value of the
minSuccessfulrecord component
-
toleratedFailureCount
Returns the value of thetoleratedFailureCountrecord component.- Returns:
- the value of the
toleratedFailureCountrecord component
-
toleratedFailurePercentage
Returns the value of thetoleratedFailurePercentagerecord component.- Returns:
- the value of the
toleratedFailurePercentagerecord component
-