Skip to content


Creating Instance

SequenceNumberFutureStore takes no parameters to be created.

SequenceNumberFutureStore initializes the sequenceNumberFutures and the lastCompletedSequenceNumber.

SequenceNumberFutureStore is created when:


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:


void completeFuturesUpToAndIncludingSequenceNumber(
  long seqNum)

completeFuturesUpToAndIncludingSequenceNumber sets the lastCompletedSequenceNumber to be the given seqNum.

completeFuturesUpToAndIncludingSequenceNumber completes and removes all CompletableFutures up to and including the given seqNum.

completeFuturesUpToAndIncludingSequenceNumber is used when: