Class DbDistributionState
java.lang.Object
io.camunda.zeebe.engine.state.distribution.DbDistributionState
- All Implemented Interfaces:
DistributionState,MutableDistributionState
-
Constructor Summary
ConstructorsConstructorDescriptionDbDistributionState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommandDistribution(long distributionKey, CommandDistributionRecord commandDistributionRecord) Adds a distribution to the statevoidaddPendingDistribution(long distributionKey, int partition) Adds a pending distribution to the stategetCommandDistributionRecord(long distributionKey, int partition) Returns theCommandDistributionRecordfor the given distribution key.booleanhasPendingDistribution(long distributionKey) Returns whether there are any distributions pending for a given key.booleanhasPendingDistribution(long distributionKey, int partition) Returns whether a specific distribution for a specific partition is pending.voidremoveCommandDistribution(long distributionKey) Removed a distribution from the statevoidremovePendingDistribution(long distributionKey, int partition) Removes a pending distribution fromm the state
-
Constructor Details
-
DbDistributionState
public DbDistributionState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext)
-
-
Method Details
-
addCommandDistribution
public void addCommandDistribution(long distributionKey, CommandDistributionRecord commandDistributionRecord) Description copied from interface:MutableDistributionStateAdds a distribution to the state- Specified by:
addCommandDistributionin interfaceMutableDistributionState- Parameters:
distributionKey- the key of the distributioncommandDistributionRecord- the distribution record that needs to be stored
-
removeCommandDistribution
public void removeCommandDistribution(long distributionKey) Description copied from interface:MutableDistributionStateRemoved a distribution from the state- Specified by:
removeCommandDistributionin interfaceMutableDistributionState- Parameters:
distributionKey- the key of the distribution that will be removed
-
addPendingDistribution
public void addPendingDistribution(long distributionKey, int partition) Description copied from interface:MutableDistributionStateAdds a pending distribution to the state- Specified by:
addPendingDistributionin interfaceMutableDistributionState- Parameters:
distributionKey- the key of the distributionpartition- the partition for which the distribution is pending
-
removePendingDistribution
public void removePendingDistribution(long distributionKey, int partition) Description copied from interface:MutableDistributionStateRemoves a pending distribution fromm the state- Specified by:
removePendingDistributionin interfaceMutableDistributionState- Parameters:
distributionKey- the key of the pending distribution that will be removedpartition- the partition of the pending distribution that will be removed
-
hasPendingDistribution
public boolean hasPendingDistribution(long distributionKey) Description copied from interface:DistributionStateReturns whether there are any distributions pending for a given key.- Specified by:
hasPendingDistributionin interfaceDistributionState- Parameters:
distributionKey- the key of the distribution- Returns:
- true if there are pending distributions for the given key, otherwise false
-
hasPendingDistribution
public boolean hasPendingDistribution(long distributionKey, int partition) Description copied from interface:DistributionStateReturns whether a specific distribution for a specific partition is pending.- Specified by:
hasPendingDistributionin interfaceDistributionState- Parameters:
distributionKey- the key of the distribution that may be pendingpartition- the id of the partition for which the distribution might be pending- Returns:
trueif the specific pending distribution exists, otherwisefalse.
-
getCommandDistributionRecord
Description copied from interface:DistributionStateReturns theCommandDistributionRecordfor the given distribution key. This method takes a partition id. This is only used to set the partition property in theCommandDistributionRecord. Doing so allows us to return a whole record, without the need to remember setting the partition everytime this method is called.- Specified by:
getCommandDistributionRecordin interfaceDistributionState- Parameters:
distributionKey- the key of the distributionpartition- the partition to distribute to- Returns:
- an new instance of the
CommandDistributionRecord
-