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 TypeMethodDescriptionvoid
Completely clears all caches.void
deleteDecision
(DecisionRecord record) Deletes a decision from the state.void
Deletes 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.void
storeDecisionRecord
(DecisionRecord record) Put the given decision in the state.void
Put 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:DecisionState
Query decisions by the given decision id and return the latest version of the decision.- Specified by:
findLatestDecisionByIdAndTenant
in 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:DecisionState
Query decisions by the given decision key and return the decision.- Specified by:
findDecisionByTenantAndKey
in 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:DecisionState
Query decision requirements (DRGs) by the given decision requirements id and return the latest version of the DRG.- Specified by:
findLatestDecisionRequirementsByTenantAndId
in 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:DecisionState
Query decision requirements (DRGs) by the given decision requirements key.- Specified by:
findDecisionRequirementsByTenantAndKey
in 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:DecisionState
Query decisions by the given decision requirements (DRG) key.- Specified by:
findDecisionsByTenantAndDecisionRequirementsKey
in 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:DecisionState
Completely clears all caches.- Specified by:
clearCache
in interfaceDecisionState
-
storeDecisionRecord
Description copied from interface:MutableDecisionState
Put the given decision in the state. Update the latest version of the decision if it is newer.- Specified by:
storeDecisionRecord
in interfaceMutableDecisionState
- Parameters:
record
- the record of the decision
-
storeDecisionRequirements
Description copied from interface:MutableDecisionState
Put the given decision requirements (DRG) in the state. Update the latest version of the DRG if it is newer.- Specified by:
storeDecisionRequirements
in interfaceMutableDecisionState
- Parameters:
record
- the record of the DRG
-
deleteDecision
Description copied from interface:MutableDecisionState
Deletes 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:
deleteDecision
in interfaceMutableDecisionState
- Parameters:
record
- the record of the decision
-
deleteDecisionRequirements
Description copied from interface:MutableDecisionState
Deletes 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:
deleteDecisionRequirements
in interfaceMutableDecisionState
- Parameters:
record
- the record of the decision requirements
-