Interface DistributionState
- All Known Subinterfaces:
MutableDistributionState
- All Known Implementing Classes:
DbDistributionState
public interface DistributionState
-
Method Summary
Modifier and TypeMethodDescriptiongetCommandDistributionRecord
(long distributionKey, int partition) Returns theCommandDistributionRecord
for the given distribution key.boolean
hasPendingDistribution
(long distributionKey) Returns whether there are any distributions pending for a given key.boolean
hasPendingDistribution
(long distributionKey, int partition) Returns whether a specific distribution for a specific partition is pending.
-
Method Details
-
hasPendingDistribution
boolean hasPendingDistribution(long distributionKey) Returns whether there are any distributions pending for a given key.- Parameters:
distributionKey
- the key of the distribution- Returns:
- true if there are pending distributions for the given key, otherwise false
-
hasPendingDistribution
boolean hasPendingDistribution(long distributionKey, int partition) Returns whether a specific distribution for a specific partition is pending.- Parameters:
distributionKey
- the key of the distribution that may be pendingpartition
- the id of the partition for which the distribution might be pending- Returns:
true
if the specific pending distribution exists, otherwisefalse
.
-
getCommandDistributionRecord
Returns theCommandDistributionRecord
for 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.- Parameters:
distributionKey
- the key of the distributionpartition
- the partition to distribute to- Returns:
- an new instance of the
CommandDistributionRecord
-