Class DefaultCheckpointers

java.lang.Object
org.hyperledger.fabric.gateway.DefaultCheckpointers

public final class DefaultCheckpointers extends Object
Provides static factory methods used to create instances of default Checkpointer implementations.
  • Method Details

    • file

      public static Checkpointer file(Path path) throws IOException
      Checkpointer implementation that persists state to a given file. If the file exists, it must contain valid persistent checkpoint state. If the file does not exist, the checkpointer will be created with default initial state, which will start listening from the current block.

      The checkpointer will attempt to obtain an exclusive lock on the file so there can only be a single checkpointer instance for a given file at any point in time.

      Parameters:
      path - A file path.
      Returns:
      A checkpointer.
      Throws:
      IOException - if an error occurs creating the checkpointer.