org.hyperledger.fabric.gateway.spi

## 接口 Checkpointer

- 所有超级接口:
    AutoCloseable

      public interface Checkpointer
      extends AutoCloseable

  Persists the current block and transactions within that block to enable event listening to be resumed following an application outage.

  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.

- - ### 字段详细资料

    - #### UNSET_BLOCK_NUMBER

          static final long UNSET_BLOCK_NUMBER

      Block number indicating no stored value. This is the the default for a newly created checkpointer with no previously saved state.
      另请参阅:
        常量字段值

  - ### 方法详细资料

    - #### getBlockNumber

          long getBlockNumber()
                       throws IOException

      Get the current block number, or `UNSET_BLOCK_NUMBER` if there is no previously saved state.
      返回:
        A block number.
      抛出:
        `IOException` - if the checkpointer fails to access persistent state.

    - #### setBlockNumber

          void setBlockNumber(long blockNumber)
                       throws IOException

      Set the current block number. Also clears the stored transaction IDs. Typically set when the previous block has been processed.
      参数:
        `blockNumber` - A block number.
      抛出:
        `IOException` - if the checkpointer fails to access persistent state.

    - #### getTransactionIds

          Set<String> getTransactionIds()
                                 throws IOException

      Get the transaction IDs processed within the current block.
      返回:
        Transaction IDs.
      抛出:
        `IOException` - if the checkpointer fails to access persistent state.

    - #### addTransactionId

          void addTransactionId(String transactionId)
                         throws IOException

      Add a transaction ID for the current block. Typically called once a transaction has been processed.
      参数:
        `transactionId` - A transaction ID.
      抛出:
        `IOException` - if the checkpointer fails to access persistent state.

    - #### close

          void close()
              throws IOException

      指定者:
        `close` 在接口中 `AutoCloseable`
      抛出:
        `IOException`

Copyright © 2023. All rights reserved.