Interface Snapshotter

All Superinterfaces:
Configurable

@Incubating public interface Snapshotter extends Configurable
Snapshotter is used to determine the following details about the snapshot process:

- Whether a snapshot occurs.
- Whether streaming continues during the snapshot.
- Whether the snapshot includes schema (if supported).
- Whether to snapshot data or schema following an error.

Although Debezium provides many default snapshot modes, to provide more advanced functionality, such as partial snapshots, you can customize implementation of the interface. For more information, see the documentation.

Author:
Mario Fiore Vitale
  • Method Details

    • name

      String name()
      Returns:
      the name of the snapshotter.
    • shouldSnapshotData

      boolean shouldSnapshotData(boolean offsetExists, boolean snapshotInProgress)
      Parameters:
      offsetExists - is true when the connector has an offset context (i.e. restarted)
      snapshotInProgress - is true when the connector is started, but a snapshot is already in progress
      Returns:
      true if the snapshotter should take a data snapshot
    • shouldSnapshotSchema

      boolean shouldSnapshotSchema(boolean offsetExists, boolean snapshotInProgress)
      Parameters:
      offsetExists - is true when the connector has an offset context (i.e. restarted)
      snapshotInProgress - is true when the connector is started, but a snapshot is already in progress
      Returns:
      true if the snapshotter should take a schema snapshot
    • shouldStream

      boolean shouldStream()
      Returns:
      true if the snapshotter should stream after taking a snapshot
    • shouldSnapshotOnSchemaError

      boolean shouldSnapshotOnSchemaError()
      Returns:
      true whether the schema can be recovered if database schema history is corrupted.
    • shouldSnapshotOnDataError

      boolean shouldSnapshotOnDataError()
      Returns:
      true whether the snapshot should be re-executed when there is a gap in data stream.
    • shouldStreamEventsStartingFromSnapshot

      default boolean shouldStreamEventsStartingFromSnapshot()
      Returns:
      true if streaming should resume from the start of the snapshot transaction, or false for when a connector resumes and takes a snapshot, streaming should resume from where streaming previously left off.
    • snapshotCompleted

      default void snapshotCompleted()
      Lifecycle hook called after the snapshot phase is successful.
    • snapshotAborted

      default void snapshotAborted()
      Lifecycle hook called after the snapshot phase is aborted.