Class DbDecisionState
java.lang.Object
io.camunda.zeebe.engine.state.deployment.DbDecisionState
- All Implemented Interfaces:
DecisionState,MutableDecisionState
-
Constructor Summary
ConstructorsConstructorDescriptionDbDecisionState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, EngineConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionvoidCompletely clears all caches.voiddeleteDecision(DecisionRecord record) Deletes a decision from the state.voidDeletes a decision requirements from the state.findDecisionByTenantAndKey(String tenantId, long decisionKey) Query decisions by the given decision key and return the decision.findDecisionRequirementsByTenantAndKey(String tenantId, long decisionRequirementsKey) Query decision requirements (DRGs) by the given decision requirements key.findDecisionsByTenantAndDecisionRequirementsKey(String tenantId, long decisionRequirementsKey) Query decisions by the given decision requirements (DRG) key.findLatestDecisionByIdAndTenant(org.agrona.DirectBuffer decisionId, String tenantId) Query decisions by the given decision id and return the latest version of the decision.findLatestDecisionRequirementsByTenantAndId(String tenantId, org.agrona.DirectBuffer decisionRequirementsId) Query decision requirements (DRGs) by the given decision requirements id and return the latest version of the DRG.voidstoreDecisionRecord(DecisionRecord record) Put the given decision in the state.voidPut the given decision requirements (DRG) in the state.
-
Constructor Details
-
DbDecisionState
public DbDecisionState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, EngineConfiguration config)
-
-
Method Details
-
findLatestDecisionByIdAndTenant
public Optional<PersistedDecision> findLatestDecisionByIdAndTenant(org.agrona.DirectBuffer decisionId, String tenantId) Description copied from interface:DecisionStateQuery decisions by the given decision id and return the latest version of the decision.- Specified by:
findLatestDecisionByIdAndTenantin interfaceDecisionState- Parameters:
decisionId- the id of the decisiontenantId- the tenant the decision belongs to- Returns:
- the latest version of the decision, or
Optional.empty()if no decision is deployed with the given id
-
findDecisionByTenantAndKey
Description copied from interface:DecisionStateQuery decisions by the given decision key and return the decision.- Specified by:
findDecisionByTenantAndKeyin interfaceDecisionState- Parameters:
tenantId- the tenant the decision belongs todecisionKey- the key of the decision- Returns:
- the decision, or
Optional.empty()if no decision is deployed with the given key
-
findLatestDecisionRequirementsByTenantAndId
public Optional<DeployedDrg> findLatestDecisionRequirementsByTenantAndId(String tenantId, org.agrona.DirectBuffer decisionRequirementsId) Description copied from interface:DecisionStateQuery decision requirements (DRGs) by the given decision requirements id and return the latest version of the DRG.- Specified by:
findLatestDecisionRequirementsByTenantAndIdin interfaceDecisionState- Parameters:
tenantId- the tenant the DRG belongs todecisionRequirementsId- the id of the DRG- Returns:
- the latest version of the DRG, or
Optional.empty()if no DRG is deployed with the given id
-
findDecisionRequirementsByTenantAndKey
public Optional<DeployedDrg> findDecisionRequirementsByTenantAndKey(String tenantId, long decisionRequirementsKey) Description copied from interface:DecisionStateQuery decision requirements (DRGs) by the given decision requirements key.- Specified by:
findDecisionRequirementsByTenantAndKeyin interfaceDecisionState- Parameters:
tenantId- the tenant the DRG belongs todecisionRequirementsKey- the key of the DRG- Returns:
- the DRG, or
Optional.empty()if no DRG is deployed with the given key
-
findDecisionsByTenantAndDecisionRequirementsKey
public List<PersistedDecision> findDecisionsByTenantAndDecisionRequirementsKey(String tenantId, long decisionRequirementsKey) Description copied from interface:DecisionStateQuery decisions by the given decision requirements (DRG) key.- Specified by:
findDecisionsByTenantAndDecisionRequirementsKeyin interfaceDecisionState- Parameters:
tenantId- the tenant the DRG belongs todecisionRequirementsKey- the key of the DRG- Returns:
- all decisions that belong to the given DRG, or an empty list if no decision belongs to it
-
clearCache
public void clearCache()Description copied from interface:DecisionStateCompletely clears all caches.- Specified by:
clearCachein interfaceDecisionState
-
storeDecisionRecord
Description copied from interface:MutableDecisionStatePut the given decision in the state. Update the latest version of the decision if it is newer.- Specified by:
storeDecisionRecordin interfaceMutableDecisionState- Parameters:
record- the record of the decision
-
storeDecisionRequirements
Description copied from interface:MutableDecisionStatePut the given decision requirements (DRG) in the state. Update the latest version of the DRG if it is newer.- Specified by:
storeDecisionRequirementsin interfaceMutableDecisionState- Parameters:
record- the record of the DRG
-
deleteDecision
Description copied from interface:MutableDecisionStateDeletes a decision from the state. Updates the latest version of the decision if the deleted version is the latest version and a previous version is available.- Specified by:
deleteDecisionin interfaceMutableDecisionState- Parameters:
record- the record of the decision
-
deleteDecisionRequirements
Description copied from interface:MutableDecisionStateDeletes a decision requirements from the state. Updates the latest version of the decision requirements if the deleted version is the latest version and a previous version is available.- Specified by:
deleteDecisionRequirementsin interfaceMutableDecisionState- Parameters:
record- the record of the decision requirements
-