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.SnapshotContext, RelationalSnapshotChangeEventSource.SnapshottingTaskChangeEventSource.ChangeEventSourceContext| Modifier and Type | Field and Description |
|---|---|
private PostgresConnectorConfig |
connectorConfig |
private PostgresConnection |
jdbcConnection |
private static org.slf4j.Logger |
LOGGER |
private PostgresSchema |
schema |
private SlotCreationResult |
slotCreatedInfo |
private Snapshotter |
snapshotter |
clock| Constructor and Description |
|---|
PostgresSnapshotChangeEventSource(PostgresConnectorConfig connectorConfig,
Snapshotter snapshotter,
PostgresOffsetContext previousOffset,
PostgresConnection jdbcConnection,
PostgresSchema schema,
EventDispatcher<TableId> dispatcher,
Clock clock,
SnapshotProgressListener snapshotProgressListener,
SlotCreationResult slotCreatedInfo) |
execute, getChangeRecordEmitter, getClockprivate 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
public PostgresSnapshotChangeEventSource(PostgresConnectorConfig connectorConfig, Snapshotter snapshotter, PostgresOffsetContext previousOffset, PostgresConnection jdbcConnection, PostgresSchema schema, EventDispatcher<TableId> dispatcher, Clock clock, SnapshotProgressListener snapshotProgressListener, SlotCreationResult slotCreatedInfo)
protected RelationalSnapshotChangeEventSource.SnapshottingTask getSnapshottingTask(OffsetContext previousOffset)
getSnapshottingTask in class RelationalSnapshotChangeEventSourceprotected RelationalSnapshotChangeEventSource.SnapshotContext prepare(ChangeEventSource.ChangeEventSourceContext context) throws Exception
prepare in class RelationalSnapshotChangeEventSourceExceptionprotected void connectionCreated(RelationalSnapshotChangeEventSource.SnapshotContext snapshotContext) throws Exception
connectionCreated in class RelationalSnapshotChangeEventSourceExceptionprotected Set<TableId> getAllTableIds(RelationalSnapshotChangeEventSource.SnapshotContext ctx) throws Exception
getAllTableIds in class RelationalSnapshotChangeEventSourceExceptionprotected void lockTablesForSchemaSnapshot(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.SnapshotContext snapshotContext) throws SQLException, InterruptedException
lockTablesForSchemaSnapshot in class RelationalSnapshotChangeEventSourceSQLExceptionInterruptedExceptionprotected void releaseSchemaSnapshotLocks(RelationalSnapshotChangeEventSource.SnapshotContext snapshotContext) throws SQLException
releaseSchemaSnapshotLocks in class RelationalSnapshotChangeEventSourceSQLExceptionprotected void determineSnapshotOffset(RelationalSnapshotChangeEventSource.SnapshotContext ctx) throws Exception
determineSnapshotOffset in class RelationalSnapshotChangeEventSourceExceptionprivate long getTransactionStartLsn()
throws SQLException
SQLExceptionprotected void readTableStructure(ChangeEventSource.ChangeEventSourceContext sourceContext, RelationalSnapshotChangeEventSource.SnapshotContext snapshotContext) throws SQLException, InterruptedException
readTableStructure in class RelationalSnapshotChangeEventSourceSQLExceptionInterruptedExceptionprotected SchemaChangeEvent getCreateTableEvent(RelationalSnapshotChangeEventSource.SnapshotContext snapshotContext, Table table) throws SQLException
getCreateTableEvent in class RelationalSnapshotChangeEventSourceSQLExceptionprotected void complete(RelationalSnapshotChangeEventSource.SnapshotContext snapshotContext)
complete in class RelationalSnapshotChangeEventSourceprotected Optional<String> getSnapshotSelect(RelationalSnapshotChangeEventSource.SnapshotContext snapshotContext, TableId tableId)
getSnapshotSelect in class RelationalSnapshotChangeEventSourceprotected Object getColumnValue(ResultSet rs, int columnIndex, Column column) throws SQLException
getColumnValue in class RelationalSnapshotChangeEventSourceSQLExceptionCopyright © 2019 JBoss by Red Hat. All rights reserved.