@Internal public interface StateChangelogWriter<Handle extends ChangelogStateHandle> extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
append(int keyGroup,
byte[] value)
Appends the provided data to this log.
|
void |
close()
Close this log.
|
void |
confirm(SequenceNumber from,
SequenceNumber to)
Mark the given state changes as confirmed by the JM.
|
SequenceNumber |
getLowestSequenceNumber() |
SequenceNumber |
initialSequenceNumber()
Get the initial
SequenceNumber that is used for the first element. |
SequenceNumber |
nextSequenceNumber()
Get
SequenceNumber to be used for the next element added by append. |
CompletableFuture<Handle> |
persist(SequenceNumber from)
Durably persist previously
appended data starting from the
provided SequenceNumber and up to the latest change added. |
void |
reset(SequenceNumber from,
SequenceNumber to)
Reset the state the given state changes.
|
void |
truncate(SequenceNumber to)
Truncate in-memory view of this state changelog to free up resources.
|
SequenceNumber initialSequenceNumber()
SequenceNumber that is used for the first element.SequenceNumber nextSequenceNumber()
SequenceNumber to be used for the next element added by append.void append(int keyGroup,
byte[] value)
throws IOException
IOExceptionCompletableFuture<Handle> persist(SequenceNumber from) throws IOException
appended data starting from the
provided SequenceNumber and up to the latest change added. After this call, one of
confirm, reset, or truncate eventually must be
called for the corresponding change set. with reset/truncate/confirm methods?from - inclusiveIOExceptionvoid truncate(SequenceNumber to)
persisted state changes will not be
discarded; any ongoing persist calls will not be affected.to - exclusivevoid confirm(SequenceNumber from, SequenceNumber to)
from - inclusiveto - exclusivevoid reset(SequenceNumber from, SequenceNumber to)
void close()
close in interface AutoCloseable@VisibleForTesting SequenceNumber getLowestSequenceNumber()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.