Record Class TaskOptions

java.lang.Object
java.lang.Record
org.j7m.middleware.workload.api.TaskOptions
Record Components:
deliverySemantics - requested delivery semantics
idempotencyKey - optional idempotency key
duplicateDetectionKey - optional duplicate-detection key
deadline - maximum time the scheduler should keep or run the task
retryPolicy - retry policy for idempotent work
priority - relative priority, higher values are preferred
orderingRequirement - ordering requirement
shardKey - optional shard key
maxPayloadBytes - payload limit
maxResultBytes - result limit
backpressureMode - requested backpressure mode
metadata - safe options metadata

public record TaskOptions(DeliverySemantics deliverySemantics, String idempotencyKey, String duplicateDetectionKey, Duration deadline, RetryPolicy retryPolicy, int priority, OrderingRequirement orderingRequirement, ShardKey shardKey, int maxPayloadBytes, int maxResultBytes, BackpressureMode backpressureMode, Map<String,String> metadata) extends Record
Immutable task submission options.
  • Constructor Details

  • Method Details

    • defaults

      public static TaskOptions defaults()
      Returns conservative default options.
      Returns:
      default options
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • deliverySemantics

      public DeliverySemantics deliverySemantics()
      Returns the value of the deliverySemantics record component.
      Returns:
      the value of the deliverySemantics record component
    • idempotencyKey

      public String idempotencyKey()
      Returns the value of the idempotencyKey record component.
      Returns:
      the value of the idempotencyKey record component
    • duplicateDetectionKey

      public String duplicateDetectionKey()
      Returns the value of the duplicateDetectionKey record component.
      Returns:
      the value of the duplicateDetectionKey record component
    • deadline

      public Duration deadline()
      Returns the value of the deadline record component.
      Returns:
      the value of the deadline record component
    • retryPolicy

      public RetryPolicy retryPolicy()
      Returns the value of the retryPolicy record component.
      Returns:
      the value of the retryPolicy record component
    • priority

      public int priority()
      Returns the value of the priority record component.
      Returns:
      the value of the priority record component
    • orderingRequirement

      public OrderingRequirement orderingRequirement()
      Returns the value of the orderingRequirement record component.
      Returns:
      the value of the orderingRequirement record component
    • shardKey

      public ShardKey shardKey()
      Returns the value of the shardKey record component.
      Returns:
      the value of the shardKey record component
    • maxPayloadBytes

      public int maxPayloadBytes()
      Returns the value of the maxPayloadBytes record component.
      Returns:
      the value of the maxPayloadBytes record component
    • maxResultBytes

      public int maxResultBytes()
      Returns the value of the maxResultBytes record component.
      Returns:
      the value of the maxResultBytes record component
    • backpressureMode

      public BackpressureMode backpressureMode()
      Returns the value of the backpressureMode record component.
      Returns:
      the value of the backpressureMode record component
    • metadata

      public Map<String,String> metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component