public interface Checkpointer extends AutoCloseable
Default implementations can be obtained from DefaultCheckpointers.
Application developers are encouraged to build their own implementations that use a persistent store suitable to
their environment.
Implementations must be thread-safe.
| Modifier and Type | Field and Description |
|---|---|
static long |
UNSET_BLOCK_NUMBER
Block number indicating no stored value.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTransactionId(String transactionId)
Add a transaction ID for the current block.
|
void |
close() |
long |
getBlockNumber()
Get the current block number, or
UNSET_BLOCK_NUMBER if there is no previously saved state. |
Set<String> |
getTransactionIds()
Get the transaction IDs processed within the current block.
|
void |
setBlockNumber(long blockNumber)
Set the current block number.
|
static final long UNSET_BLOCK_NUMBER
long getBlockNumber()
throws IOException
UNSET_BLOCK_NUMBER if there is no previously saved state.IOException - if the checkpointer fails to access persistent state.void setBlockNumber(long blockNumber)
throws IOException
blockNumber - A block number.IOException - if the checkpointer fails to access persistent state.Set<String> getTransactionIds() throws IOException
IOException - if the checkpointer fails to access persistent state.void addTransactionId(String transactionId) throws IOException
transactionId - A transaction ID.IOException - if the checkpointer fails to access persistent state.void close()
throws IOException
close in interface AutoCloseableIOExceptionCopyright © 2023. All rights reserved.