public class PostgresSnapshotChangeEventSource extends RelationalSnapshotChangeEventSource
| Modifier and Type | Class and Description |
|---|---|
private static class |
PostgresSnapshotChangeEventSource.PostgresSnapshotContext
Mutable context which is populated in the course of snapshotting.
|
RelationalSnapshotChangeEventSource.RelationalSnapshotContextAbstractSnapshotChangeEventSource.SnapshotContext, AbstractSnapshotChangeEventSource.SnapshottingTaskChangeEventSource.ChangeEventSourceContext| Modifier and Type | Field and Description |
|---|---|
private PostgresConnectorConfig |
connectorConfig |
private PostgresConnection |
jdbcConnection |
private static org.slf4j.Logger |
LOGGER |
private PostgresOffsetContext |
previousOffset |
private PostgresSchema |
schema |
private SlotCreationResult |
slotCreatedInfo |
private Snapshotter |
snapshotter |
private SlotState |
startingSlotInfo |
clock, dispatcher| Constructor and Description |
|---|
PostgresSnapshotChangeEventSource(PostgresConnectorConfig connectorConfig,
Snapshotter snapshotter,
PostgresOffsetContext previousOffset,
PostgresConnection jdbcConnection,
PostgresSchema schema,
EventDispatcher<TableId> dispatcher,
Clock clock,
SnapshotProgressListener snapshotProgressListener,
SlotCreationResult slotCreatedInfo,
SlotState startingSlotInfo) |
createSchemaChangeEventsForTables, createSnapshotConnection, doExecute, enhanceOverriddenSelect, getChangeRecordEmitter, getClock, getColumnValue, lastSnapshotRecord, postSnapshot, readTableStatement, releaseDataSnapshotLocks, rowCountForTable, tryStartingSnapshotdelaySnapshotIfNeeded, determineDataCollectionsToBeSnapshotted, executeprivate static final org.slf4j.Logger LOGGER
private final PostgresConnectorConfig connectorConfig
private final PostgresConnection jdbcConnection
private final PostgresSchema schema
private final Snapshotter snapshotter
private final SlotCreationResult slotCreatedInfo
private final SlotState startingSlotInfo
private final PostgresOffsetContext previousOffset
public PostgresSnapshotChangeEventSource(PostgresConnectorConfig connectorConfig, Snapshotter snapshotter, PostgresOffsetContext previousOffset, PostgresConnection jdbcConnection, PostgresSchema schema, EventDispatcher<TableId> dispatcher, Clock clock, SnapshotProgressListener snapshotProgressListener, SlotCreationResult slotCreatedInfo, SlotState startingSlotInfo)
protected AbstractSnapshotChangeEventSource.SnapshottingTask getSnapshottingTask(OffsetContext previousOffset)
getSnapshottingTask in class AbstractSnapshotChangeEventSourceprotected AbstractSnapshotChangeEventSource.SnapshotContext prepare(ChangeEventSource.ChangeEventSourceContext context) throws Exception
prepare in class AbstractSnapshotChangeEventSourceExceptionprotected void connectionCreated(RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext) throws Exception
connectionCreated in class RelationalSnapshotChangeEventSourceExceptionprotected Set<TableId> getAllTableIds(RelationalSnapshotChangeEventSource.RelationalSnapshotContext ctx) throws Exception
getAllTableIds in class RelationalSnapshotChangeEventSourceExceptionprotected void lockTablesForSchemaSnapshot(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext) throws SQLException, InterruptedException
lockTablesForSchemaSnapshot in class RelationalSnapshotChangeEventSourceSQLExceptionInterruptedExceptionprotected void releaseSchemaSnapshotLocks(RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext) throws SQLException
releaseSchemaSnapshotLocks in class RelationalSnapshotChangeEventSourceSQLExceptionprotected void determineSnapshotOffset(RelationalSnapshotChangeEventSource.RelationalSnapshotContext ctx) throws Exception
determineSnapshotOffset in class RelationalSnapshotChangeEventSourceExceptionprivate void updateOffsetForSnapshot(PostgresOffsetContext offset) throws SQLException
SQLExceptionprotected void updateOffsetForPreSnapshotCatchUpStreaming(PostgresOffsetContext offset) throws SQLException
SQLExceptionprivate Lsn getTransactionStartLsn() throws SQLException
SQLExceptionprotected void readTableStructure(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext) throws SQLException, InterruptedException
readTableStructure in class RelationalSnapshotChangeEventSourceSQLExceptionInterruptedExceptionprotected SchemaChangeEvent getCreateTableEvent(RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext, Table table) throws SQLException
getCreateTableEvent in class RelationalSnapshotChangeEventSourceSQLExceptionprotected void complete(AbstractSnapshotChangeEventSource.SnapshotContext snapshotContext)
complete in class AbstractSnapshotChangeEventSourceprotected Optional<String> getSnapshotSelect(RelationalSnapshotChangeEventSource.RelationalSnapshotContext snapshotContext, TableId tableId)
getSnapshotSelect in class RelationalSnapshotChangeEventSourceprotected Object getColumnValue(ResultSet rs, int columnIndex, Column column) throws SQLException
getColumnValue in class RelationalSnapshotChangeEventSourceSQLExceptionprotected void setSnapshotTransactionIsolationLevel()
throws SQLException
SQLExceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.