Class DbJobState
- java.lang.Object
-
- io.camunda.zeebe.engine.state.instance.DbJobState
-
- All Implemented Interfaces:
JobState
,MutableJobState
public final class DbJobState extends Object implements JobState, MutableJobState
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.camunda.zeebe.engine.state.immutable.JobState
JobState.State
-
-
Constructor Summary
Constructors Constructor Description DbJobState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, int partitionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(long key, JobRecord record)
Note: calling this method will reset the variables of the job record.void
cancel(long key, JobRecord record)
void
complete(long key, JobRecord record)
void
create(long key, JobRecord record)
void
delete(long key, JobRecord record)
void
disable(long key, JobRecord record)
boolean
exists(long jobKey)
void
fail(long key, JobRecord updatedValue)
void
forEachActivatableJobs(org.agrona.DirectBuffer type, BiFunction<Long,JobRecord,Boolean> callback)
void
forEachTimedOutEntry(long upperBound, BiFunction<Long,JobRecord,Boolean> callback)
JobRecord
getJob(long key)
JobState.State
getState(long key)
boolean
isInState(long key, JobState.State state)
void
resolve(long key, JobRecord updatedValue)
void
setJobsAvailableCallback(Consumer<String> onJobsAvailableCallback)
void
throwError(long key, JobRecord updatedValue)
void
timeout(long key, JobRecord record)
JobRecord
updateJobRetries(long jobKey, int retries)
-
-
-
Constructor Detail
-
DbJobState
public DbJobState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, int partitionId)
-
-
Method Detail
-
create
public void create(long key, JobRecord record)
- Specified by:
create
in interfaceMutableJobState
-
activate
public void activate(long key, JobRecord record)
Note: calling this method will reset the variables of the job record. Make sure to write the job record to the log before updating it in the state.related to https://github.com/zeebe-io/zeebe/issues/2182
- Specified by:
activate
in interfaceMutableJobState
-
timeout
public void timeout(long key, JobRecord record)
- Specified by:
timeout
in interfaceMutableJobState
-
complete
public void complete(long key, JobRecord record)
- Specified by:
complete
in interfaceMutableJobState
-
cancel
public void cancel(long key, JobRecord record)
- Specified by:
cancel
in interfaceMutableJobState
-
disable
public void disable(long key, JobRecord record)
- Specified by:
disable
in interfaceMutableJobState
-
throwError
public void throwError(long key, JobRecord updatedValue)
- Specified by:
throwError
in interfaceMutableJobState
-
delete
public void delete(long key, JobRecord record)
- Specified by:
delete
in interfaceMutableJobState
-
fail
public void fail(long key, JobRecord updatedValue)
- Specified by:
fail
in interfaceMutableJobState
-
resolve
public void resolve(long key, JobRecord updatedValue)
- Specified by:
resolve
in interfaceMutableJobState
-
updateJobRetries
public JobRecord updateJobRetries(long jobKey, int retries)
- Specified by:
updateJobRetries
in interfaceMutableJobState
-
forEachTimedOutEntry
public void forEachTimedOutEntry(long upperBound, BiFunction<Long,JobRecord,Boolean> callback)
- Specified by:
forEachTimedOutEntry
in interfaceJobState
-
getState
public JobState.State getState(long key)
-
isInState
public boolean isInState(long key, JobState.State state)
-
forEachActivatableJobs
public void forEachActivatableJobs(org.agrona.DirectBuffer type, BiFunction<Long,JobRecord,Boolean> callback)
- Specified by:
forEachActivatableJobs
in interfaceJobState
-
setJobsAvailableCallback
public void setJobsAvailableCallback(Consumer<String> onJobsAvailableCallback)
- Specified by:
setJobsAvailableCallback
in interfaceJobState
-
-