Record Class JobLease
java.lang.Object
java.lang.Record
com.kingsrook.qqq.backend.core.jobs.model.JobLease
- Record Components:
chunkId- the leased chunkjobId- its jobseq- the chunk's sequence in the jobattempt- the attempt number this lease runs (1 = first)podId- the pod holding the leasetoken- the fencing tokenexpiresAt- when the lease ends without a heartbeat (database clock)
public record JobLease(Integer chunkId, Integer jobId, Integer seq, Integer attempt, String podId, String token, Instant expiresAt)
extends Record
A worker's lease on one chunk. Every chunk write (progress, checkpoint,
completion) is fenced by the token: a writer whose lease was reclaimed fails.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattempt()Returns the value of theattemptrecord component.chunkId()Returns the value of thechunkIdrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpiresAtrecord component.final inthashCode()Returns a hash code value for this object.jobId()Returns the value of thejobIdrecord component.podId()Returns the value of thepodIdrecord component.seq()Returns the value of theseqrecord component.token()Returns the value of thetokenrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
JobLease
public JobLease(Integer chunkId, Integer jobId, Integer seq, Integer attempt, String podId, String token, Instant expiresAt) Creates an instance of aJobLeaserecord class.- Parameters:
chunkId- the value for thechunkIdrecord componentjobId- the value for thejobIdrecord componentseq- the value for theseqrecord componentattempt- the value for theattemptrecord componentpodId- the value for thepodIdrecord componenttoken- the value for thetokenrecord componentexpiresAt- the value for theexpiresAtrecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
chunkId
-
jobId
-
seq
-
attempt
-
podId
-
token
-
expiresAt
-