Interface JobState
- All Known Subinterfaces:
MutableJobState
- All Known Implementing Classes:
DbJobState
public interface JobState
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final record
Index to point to a specific position in the jobs with deadline column family.static enum
-
Method Summary
Modifier and TypeMethodDescriptionboolean
exists
(long jobKey) long
findBackedOffJobs
(long timestamp, BiPredicate<Long, JobRecord> callback) void
forEachActivatableJobs
(org.agrona.DirectBuffer type, BiFunction<Long, JobRecord, Boolean> callback) forEachTimedOutEntry
(long executionTimestamp, JobState.DeadlineIndex startAt, BiPredicate<Long, JobRecord> callback) Loops over all timed-out job entries and applies the provided callback.getJob
(long key) getState
(long key) boolean
isInState
(long key, JobState.State state)
-
Method Details
-
forEachTimedOutEntry
JobState.DeadlineIndex forEachTimedOutEntry(long executionTimestamp, JobState.DeadlineIndex startAt, BiPredicate<Long, JobRecord> callback) Loops over all timed-out job entries and applies the provided callback.- Parameters:
executionTimestamp
- Timestamp against which it's determined whether the deadline has expiredstartAt
- Index used to start the iteration at; looping starts at the beginning when startAt isnull
callback
- A callback method to be applied to each job entry. It must return a boolean that whentrue
allows the loop to continue, or whenfalse
stops iteration.- Returns:
- The last visited index where the iteration has stopped because the
callback
method returned false ornull
if it was not the case.
-
exists
boolean exists(long jobKey) -
getState
-
isInState
-
forEachActivatableJobs
void forEachActivatableJobs(org.agrona.DirectBuffer type, BiFunction<Long, JobRecord, Boolean> callback) -
getJob
-
findBackedOffJobs
-