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 Details

    • CompletionConfig

      public CompletionConfig(Integer minSuccessful, Integer toleratedFailureCount, Double toleratedFailurePercentage)
      Creates an instance of a CompletionConfig record class.
      Parameters:
      minSuccessful - the value for the minSuccessful record component
      toleratedFailureCount - the value for the toleratedFailureCount record component
      toleratedFailurePercentage - the value for the toleratedFailurePercentage record component
  • Method Details

    • allSuccessful

      public static CompletionConfig allSuccessful()
      All items must succeed. Zero failures tolerated.
    • allCompleted

      public static CompletionConfig allCompleted()
      All items run regardless of failures. Failures captured per-item.
    • firstSuccessful

      public static CompletionConfig firstSuccessful()
      Complete as soon as the first item succeeds.
    • minSuccessful

      public static CompletionConfig minSuccessful(int count)
      Complete when the specified number of items have succeeded.
    • toleratedFailureCount

      public static CompletionConfig toleratedFailureCount(int count)
      Complete when more than the specified number of failures have occurred.
    • toleratedFailurePercentage

      public static CompletionConfig toleratedFailurePercentage(double percentage)
      Complete when the failure percentage exceeds the specified threshold (0.0 to 1.0).
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • minSuccessful

      public Integer minSuccessful()
      Returns the value of the minSuccessful record component.
      Returns:
      the value of the minSuccessful record component
    • toleratedFailureCount

      public Integer toleratedFailureCount()
      Returns the value of the toleratedFailureCount record component.
      Returns:
      the value of the toleratedFailureCount record component
    • toleratedFailurePercentage

      public Double toleratedFailurePercentage()
      Returns the value of the toleratedFailurePercentage record component.
      Returns:
      the value of the toleratedFailurePercentage record component