Record Class SagaLoad

java.lang.Object
java.lang.Record
org.acemq.workloads.SagaLoad
Record Components:
steps - steps per saga, at least one
stepTime - how long each step and each compensation takes
failureRate - probability that a step fails, between 0 and 1
compensationFailureRate - probability that a compensation fails, between 0 and 1

public record SagaLoad(int steps, Duration stepTime, double failureRate, double compensationFailureRate) extends Record
A saga each consumed message runs: the library's Saga, with simulated steps.

Every step takes stepTime and fails with probability failureRate. A failure runs the compensations of the steps already done, newest first; each takes stepTime too and fails with probability compensationFailureRate. A compensation that failed is what the library calls unresolved: a fact a person has to reconcile.

  • Constructor Details

    • SagaLoad

      public SagaLoad(int steps, Duration stepTime, double failureRate, double compensationFailureRate)
      Creates an instance of a SagaLoad record class.
      Parameters:
      steps - the value for the steps record component
      stepTime - the value for the stepTime record component
      failureRate - the value for the failureRate record component
      compensationFailureRate - the value for the compensationFailureRate record component
  • Method Details

    • toString

      public 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 '=='.
      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.
    • steps

      public int steps()
      Returns the value of the steps record component.
      Returns:
      the value of the steps record component
    • stepTime

      public Duration stepTime()
      Returns the value of the stepTime record component.
      Returns:
      the value of the stepTime record component
    • failureRate

      public double failureRate()
      Returns the value of the failureRate record component.
      Returns:
      the value of the failureRate record component
    • compensationFailureRate

      public double compensationFailureRate()
      Returns the value of the compensationFailureRate record component.
      Returns:
      the value of the compensationFailureRate record component