Class QueryingSnapshotter
- java.lang.Object
-
- io.debezium.connector.postgresql.snapshot.QueryingSnapshotter
-
- All Implemented Interfaces:
Snapshotter
- Direct Known Subclasses:
AlwaysSnapshotter,InitialOnlySnapshotter,InitialSnapshotter
public abstract class QueryingSnapshotter extends Object implements Snapshotter
-
-
Constructor Summary
Constructors Constructor Description QueryingSnapshotter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>buildSnapshotQuery(TableId tableId, List<String> snapshotSelectColumns)Generate a valid postgres query string for the specified table, or an emptyOptionalto skip snapshotting this table (but that table will still be streamed from)voidinit(PostgresConnectorConfig config, OffsetState sourceInfo, SlotState slotState)Optional<String>snapshotTableLockingStatement(Duration lockTimeout, Set<TableId> tableIds)Returns a SQL statement for locking the given tables during snapshotting, if required by the specific snapshotter implementation.StringsnapshotTransactionIsolationLevelStatement(SlotCreationResult newSlotInfo)Return a new string that set up the transaction for snapshotting-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.debezium.connector.postgresql.spi.Snapshotter
shouldSnapshot, shouldStream, shouldStreamEventsStartingFromSnapshot, snapshotCompleted
-
-
-
-
Method Detail
-
init
public void init(PostgresConnectorConfig config, OffsetState sourceInfo, SlotState slotState)
- Specified by:
initin interfaceSnapshotter
-
buildSnapshotQuery
public Optional<String> buildSnapshotQuery(TableId tableId, List<String> snapshotSelectColumns)
Description copied from interface:SnapshotterGenerate a valid postgres query string for the specified table, or an emptyOptionalto skip snapshotting this table (but that table will still be streamed from)- Specified by:
buildSnapshotQueryin interfaceSnapshotter- Parameters:
tableId- the table to generate a query forsnapshotSelectColumns- the columns to be used in the snapshot select based on the column include/exclude filters- Returns:
- a valid query string, or none to skip snapshotting this table
-
snapshotTableLockingStatement
public Optional<String> snapshotTableLockingStatement(Duration lockTimeout, Set<TableId> tableIds)
Description copied from interface:SnapshotterReturns a SQL statement for locking the given tables during snapshotting, if required by the specific snapshotter implementation.- Specified by:
snapshotTableLockingStatementin interfaceSnapshotter
-
snapshotTransactionIsolationLevelStatement
public String snapshotTransactionIsolationLevelStatement(SlotCreationResult newSlotInfo)
Description copied from interface:SnapshotterReturn a new string that set up the transaction for snapshotting- Specified by:
snapshotTransactionIsolationLevelStatementin interfaceSnapshotter- Parameters:
newSlotInfo- if a new slow was created for snapshotting, this contains information from the `create_replication_slot` command
-
-