Class DbProcessState
java.lang.Object
io.camunda.zeebe.engine.state.deployment.DbProcessState
- All Implemented Interfaces:
ProcessState
,MutableProcessState
-
Constructor Summary
ConstructorsConstructorDescriptionDbProcessState
(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, EngineConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionvoid
TODO: Remove the cache entirely from the immutable statevoid
deleteProcess
(ProcessRecord processRecord) Deletes a process fromm the state and cachefindProcessVersionBefore
(String bpmnProcessId, long version, String tenantId) Finds the previous known version a process.<T extends ExecutableFlowElement>
TgetFlowElement
(long processDefinitionKey, String tenantId, org.agrona.DirectBuffer elementId, Class<T> elementType) int
getLatestProcessVersion
(String bpmnProcessId, String tenantId) Gets the latest process version.getLatestProcessVersionByProcessId
(org.agrona.DirectBuffer processIdBuffer, String tenantId) org.agrona.DirectBuffer
getLatestVersionDigest
(org.agrona.DirectBuffer processIdBuffer, String tenantId) int
getNextProcessVersion
(String bpmnProcessId, String tenantId) Gets the next version a process of a given id will receive.getProcessByKeyAndTenant
(long key, String tenantId) getProcessByProcessIdAndVersion
(org.agrona.DirectBuffer processId, int version, String tenantId) void
putDeployment
(DeploymentRecord deploymentRecord) void
putLatestVersionDigest
(ProcessRecord processRecord) void
putProcess
(long key, ProcessRecord processRecord) void
updateProcessState
(ProcessRecord processRecord, PersistedProcess.PersistedProcessState state) Updates the state of a process.
-
Constructor Details
-
DbProcessState
public DbProcessState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, EngineConfiguration config)
-
-
Method Details
-
putDeployment
- Specified by:
putDeployment
in interfaceMutableProcessState
-
putLatestVersionDigest
- Specified by:
putLatestVersionDigest
in interfaceMutableProcessState
-
putProcess
- Specified by:
putProcess
in interfaceMutableProcessState
-
updateProcessState
public void updateProcessState(ProcessRecord processRecord, PersistedProcess.PersistedProcessState state) Description copied from interface:MutableProcessState
Updates the state of a process. This method updates both the ColumnFamily and the in memory cache.- Specified by:
updateProcessState
in interfaceMutableProcessState
- Parameters:
processRecord
- the record of the process that is updatedstate
- the new state
-
deleteProcess
Description copied from interface:MutableProcessState
Deletes a process fromm the state and cache- Specified by:
deleteProcess
in interfaceMutableProcessState
- Parameters:
processRecord
- the record of the process that is deleted
-
getLatestProcessVersionByProcessId
public DeployedProcess getLatestProcessVersionByProcessId(org.agrona.DirectBuffer processIdBuffer, String tenantId) - Specified by:
getLatestProcessVersionByProcessId
in interfaceProcessState
-
getProcessByProcessIdAndVersion
public DeployedProcess getProcessByProcessIdAndVersion(org.agrona.DirectBuffer processId, int version, String tenantId) - Specified by:
getProcessByProcessIdAndVersion
in interfaceProcessState
-
getProcessByKeyAndTenant
- Specified by:
getProcessByKeyAndTenant
in interfaceProcessState
-
getLatestVersionDigest
public org.agrona.DirectBuffer getLatestVersionDigest(org.agrona.DirectBuffer processIdBuffer, String tenantId) - Specified by:
getLatestVersionDigest
in interfaceProcessState
-
getLatestProcessVersion
Description copied from interface:ProcessState
Gets the latest process version. This is the latest version for which we have a process in the state. It is not necessarily the latest version we've ever known for this process id, as process could be deleted.- Specified by:
getLatestProcessVersion
in interfaceProcessState
- Parameters:
bpmnProcessId
- the id of the process
-
getNextProcessVersion
Description copied from interface:ProcessState
Gets the next version a process of a given id will receive. This is used, for example, when a new deployment is done. Using this method we decide the version the newly deployed process receives.- Specified by:
getNextProcessVersion
in interfaceProcessState
- Parameters:
bpmnProcessId
- the id of the process
-
findProcessVersionBefore
public Optional<Integer> findProcessVersionBefore(String bpmnProcessId, long version, String tenantId) Description copied from interface:ProcessState
Finds the previous known version a process. This is used, for example, when a process is deleted and the timers of the previous process need to be activated.If not previous version is found, an empty optional is returned.
- Specified by:
findProcessVersionBefore
in interfaceProcessState
- Parameters:
bpmnProcessId
- the id of the processversion
- the version for which we want to find the previous version
-
getFlowElement
public <T extends ExecutableFlowElement> T getFlowElement(long processDefinitionKey, String tenantId, org.agrona.DirectBuffer elementId, Class<T> elementType) - Specified by:
getFlowElement
in interfaceProcessState
-
clearCache
public void clearCache()Description copied from interface:ProcessState
TODO: Remove the cache entirely from the immutable state- Specified by:
clearCache
in interfaceProcessState
-