Package io.debezium.spi.snapshot
Interface Snapshotter
- All Superinterfaces:
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 Summary
Modifier and TypeMethodDescriptionname()booleanshouldSnapshotData(boolean offsetExists, boolean snapshotInProgress) booleanbooleanbooleanshouldSnapshotSchema(boolean offsetExists, boolean snapshotInProgress) booleandefault booleandefault voidLifecycle hook called after the snapshot phase is aborted.default voidLifecycle hook called after the snapshot phase is successful.Methods inherited from interface io.debezium.spi.common.Configurable
configure
-
Method Details
-
name
String name()- Returns:
- the name of the snapshotter.
-
shouldSnapshotData
boolean shouldSnapshotData(boolean offsetExists, boolean snapshotInProgress) - Parameters:
offsetExists- istruewhen the connector has an offset context (i.e. restarted)snapshotInProgress- istruewhen the connector is started, but a snapshot is already in progress- Returns:
trueif the snapshotter should take a data snapshot
-
shouldSnapshotSchema
boolean shouldSnapshotSchema(boolean offsetExists, boolean snapshotInProgress) - Parameters:
offsetExists- istruewhen the connector has an offset context (i.e. restarted)snapshotInProgress- istruewhen the connector is started, but a snapshot is already in progress- Returns:
trueif the snapshotter should take a schema snapshot
-
shouldStream
boolean shouldStream()- Returns:
trueif the snapshotter should stream after taking a snapshot
-
shouldSnapshotOnSchemaError
boolean shouldSnapshotOnSchemaError()- Returns:
truewhether the schema can be recovered if database schema history is corrupted.
-
shouldSnapshotOnDataError
boolean shouldSnapshotOnDataError()- Returns:
truewhether the snapshot should be re-executed when there is a gap in data stream.
-
shouldStreamEventsStartingFromSnapshot
default boolean shouldStreamEventsStartingFromSnapshot()- Returns:
trueif streaming should resume from the start of the snapshot transaction, orfalsefor 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.
-