Class DbJobState
java.lang.Object
io.camunda.zeebe.engine.state.instance.DbJobState
- All Implemented Interfaces:
JobState
,MutableJobState
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.engine.state.immutable.JobState
JobState.DeadlineIndex, JobState.State
-
Constructor Summary
ConstructorsConstructorDescriptionDbJobState
(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
void
void
void
void
boolean
exists
(long jobKey) void
long
findBackedOffJobs
(long timestamp, BiPredicate<Long, JobRecord> callback) void
forEachActivatableJobs
(org.agrona.DirectBuffer type, List<String> tenantIds, 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) boolean
jobDeadlineExists
(long jobKey, long deadline) void
void
recurAfterBackoff
(long key, JobRecord record) void
void
void
throwError
(long key, JobRecord updatedValue) void
void
updateJobDeadline
(long jobKey, long newDeadline) updateJobRetries
(long jobKey, int retries) void
-
Constructor Details
-
DbJobState
-
-
Method Details
-
create
- Specified by:
create
in interfaceMutableJobState
-
activate
- Specified by:
activate
in interfaceMutableJobState
-
recurAfterBackoff
- Specified by:
recurAfterBackoff
in interfaceMutableJobState
-
timeout
- Specified by:
timeout
in interfaceMutableJobState
-
complete
- Specified by:
complete
in interfaceMutableJobState
-
cancel
- Specified by:
cancel
in interfaceMutableJobState
-
disable
- Specified by:
disable
in interfaceMutableJobState
-
throwError
- Specified by:
throwError
in interfaceMutableJobState
-
delete
- Specified by:
delete
in interfaceMutableJobState
-
fail
- Specified by:
fail
in interfaceMutableJobState
-
yield
- Specified by:
yield
in interfaceMutableJobState
-
resolve
- Specified by:
resolve
in interfaceMutableJobState
-
updateJobRetries
- Specified by:
updateJobRetries
in interfaceMutableJobState
-
cleanupTimeoutsWithoutJobs
public void cleanupTimeoutsWithoutJobs()- Specified by:
cleanupTimeoutsWithoutJobs
in interfaceMutableJobState
-
cleanupBackoffsWithoutJobs
public void cleanupBackoffsWithoutJobs()- Specified by:
cleanupBackoffsWithoutJobs
in interfaceMutableJobState
-
updateJobDeadline
public void updateJobDeadline(long jobKey, long newDeadline) - Specified by:
updateJobDeadline
in interfaceMutableJobState
-
migrate
- Specified by:
migrate
in interfaceMutableJobState
-
restoreBackoff
public void restoreBackoff()- Specified by:
restoreBackoff
in interfaceMutableJobState
-
forEachTimedOutEntry
public JobState.DeadlineIndex forEachTimedOutEntry(long executionTimestamp, JobState.DeadlineIndex startAt, BiPredicate<Long, JobRecord> callback) Description copied from interface:JobState
Loops over all timed-out job entries and applies the provided callback.- Specified by:
forEachTimedOutEntry
in interfaceJobState
- 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
public boolean exists(long jobKey) -
getState
-
isInState
-
forEachActivatableJobs
public void forEachActivatableJobs(org.agrona.DirectBuffer type, List<String> tenantIds, BiFunction<Long, JobRecord, Boolean> callback) - Specified by:
forEachActivatableJobs
in interfaceJobState
-
getJob
-
getJob
-
jobDeadlineExists
public boolean jobDeadlineExists(long jobKey, long deadline) - Specified by:
jobDeadlineExists
in interfaceJobState
-
findBackedOffJobs
- Specified by:
findBackedOffJobs
in interfaceJobState
-