SequenceNumberFutureStore¶
Creating Instance¶
SequenceNumberFutureStore
takes no parameters to be created.
SequenceNumberFutureStore
initializes the sequenceNumberFutures and the lastCompletedSequenceNumber.
SequenceNumberFutureStore
is created when:
CommandStore.Factory
is requested to create a CommandStore (for sequenceNumberFutureStore)
getFutureForSequenceNumber¶
CompletableFuture<Void> getFutureForSequenceNumber(
long seqNum)
For the given seqNum
less than the lastCompletedSequenceNumber, getFutureForSequenceNumber
returns a new CompletableFuture
that is already completed with null
value.
Otherwise, getFutureForSequenceNumber
requests the sequenceNumberFutures for the CompletableFuture
for the given seqNum
(if available) or creates a new one.
getFutureForSequenceNumber
is used when:
CommandStore
is requested to ensureConsumedPast
completeFuturesUpToAndIncludingSequenceNumber¶
void completeFuturesUpToAndIncludingSequenceNumber(
long seqNum)
completeFuturesUpToAndIncludingSequenceNumber
sets the lastCompletedSequenceNumber to be the given seqNum
.
completeFuturesUpToAndIncludingSequenceNumber
completes and removes all CompletableFuture
s up to and including the given seqNum
.
completeFuturesUpToAndIncludingSequenceNumber
is used when:
CommandStore
is requested to completeSatisfiedSequenceNumberFutures