@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 |
appendMeta(byte[] value)
Appends the provided **metadata** to this log.
|
void |
close()
Close this log.
|
void |
confirm(SequenceNumber from,
SequenceNumber to,
long checkpointId)
Mark the given state changes as confirmed by the JM.
|
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<SnapshotResult<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,
long checkpointId)
Reset the state the given state changes.
|
void |
subsume(long checkpointId)
Mark the state changes of the given checkpoint as subsumed.
|
void |
truncate(SequenceNumber to)
Truncate this state changelog to free up the resources and collect any garbage.
|
void |
truncateAndClose(SequenceNumber from)
Truncate the tail of log and close it.
|
SequenceNumber initialSequenceNumber()
SequenceNumber
that is used for the first element.SequenceNumber nextSequenceNumber()
SequenceNumber
to be used for the next element added by append
.void appendMeta(byte[] value) throws IOException
IOException
void append(int keyGroup, byte[] value) throws IOException
IOException
CompletableFuture<SnapshotResult<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
- inclusiveIOException
void truncate(SequenceNumber to)
WARNING: the range [from; to) must not include any range that is included into any checkpoint that is not subsumed or aborted.
to
- exclusivevoid confirm(SequenceNumber from, SequenceNumber to, long checkpointId)
from
- inclusiveto
- exclusivecheckpointId
- to confirmvoid subsume(long checkpointId)
checkpointId
- void reset(SequenceNumber from, SequenceNumber to, long checkpointId)
void truncateAndClose(SequenceNumber from)
from
- SequenceNumber
from which to truncate the changelog, inclusivevoid close()
close
in interface AutoCloseable
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.