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.
限定符和类型 | 字段和说明 |
---|---|
static long |
UNSET_BLOCK_NUMBER
Block number indicating no stored value.
|
限定符和类型 | 方法和说明 |
---|---|
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
在接口中 AutoCloseable
IOException
Copyright © 2023. All rights reserved.