Package org.acemq.workloads
Record Class SagaLoad
java.lang.Object
java.lang.Record
org.acemq.workloads.SagaLoad
- Record Components:
steps- steps per saga, at least onestepTime- how long each step and each compensation takesfailureRate- probability that a step fails, between 0 and 1compensationFailureRate- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thecompensationFailureRaterecord component.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of thefailureRaterecord component.final inthashCode()Returns a hash code value for this object.intsteps()Returns the value of thestepsrecord component.stepTime()Returns the value of thestepTimerecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
SagaLoad
Creates an instance of aSagaLoadrecord class.- Parameters:
steps- the value for thestepsrecord componentstepTime- the value for thestepTimerecord componentfailureRate- the value for thefailureRaterecord componentcompensationFailureRate- the value for thecompensationFailureRaterecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
steps
public int steps()Returns the value of thestepsrecord component.- Returns:
- the value of the
stepsrecord component
-
stepTime
Returns the value of thestepTimerecord component.- Returns:
- the value of the
stepTimerecord component
-
failureRate
public double failureRate()Returns the value of thefailureRaterecord component.- Returns:
- the value of the
failureRaterecord component
-
compensationFailureRate
public double compensationFailureRate()Returns the value of thecompensationFailureRaterecord component.- Returns:
- the value of the
compensationFailureRaterecord component
-