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.findDecisionByIdAndDeploymentKey(String tenantId, org.agrona.DirectBuffer decisionId, long deploymentKey) Query decisions by the given decision id and deployment key and return the decision.findDecisionByIdAndVersionTag(String tenantId, org.agrona.DirectBuffer decisionId, String versionTag) Query decisions by the given decision id and version tag and return the decision.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.voidStore a reference to the decision key in the state, using the decision id and deployment key as composite database key.voidStore a reference to the decision key in the state, using the decision id and version tag as composite database key.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
-
findDecisionByIdAndDeploymentKey
public Optional<PersistedDecision> findDecisionByIdAndDeploymentKey(String tenantId, org.agrona.DirectBuffer decisionId, long deploymentKey) Description copied from interface:DecisionStateQuery decisions by the given decision id and deployment key and return the decision.- Specified by:
findDecisionByIdAndDeploymentKeyin interfaceDecisionState- Parameters:
tenantId- the tenant the decision belongs todecisionId- the id of the decisiondeploymentKey- the key of the deployment the decision was deployed with- Returns:
- the decision, or
Optional.empty()if no decision with the given id was deployed with the given deployment
-
findDecisionByIdAndVersionTag
public Optional<PersistedDecision> findDecisionByIdAndVersionTag(String tenantId, org.agrona.DirectBuffer decisionId, String versionTag) Description copied from interface:DecisionStateQuery decisions by the given decision id and version tag and return the decision.- Specified by:
findDecisionByIdAndVersionTagin interfaceDecisionState- Parameters:
tenantId- the tenant the decision belongs todecisionId- the id of the decisionversionTag- the version tag of the decision- Returns:
- the decision, or
Optional.empty()if no decision with the given id and version tag is deployed
-
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
-
storeDecisionKeyByDecisionIdAndDeploymentKey
Description copied from interface:MutableDecisionStateStore a reference to the decision key in the state, using the decision id and deployment key as composite database key.- Specified by:
storeDecisionKeyByDecisionIdAndDeploymentKeyin interfaceMutableDecisionState- Parameters:
record- the record of the decision
-
storeDecisionKeyByDecisionIdAndVersionTag
Description copied from interface:MutableDecisionStateStore a reference to the decision key in the state, using the decision id and version tag as composite database key.- Specified by:
storeDecisionKeyByDecisionIdAndVersionTagin interfaceMutableDecisionState- Parameters:
record- the record of the decision
-
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
-