public class SqlServerStreamingChangeEventSource extends Object implements StreamingChangeEventSource
StreamingChangeEventSource based on SQL Server change data capture functionality.
A main polls database DDL change and change data tables and turns them into change events.| Modifier and Type | Class and Description |
|---|---|
private static class |
SqlServerStreamingChangeEventSource.ChangeTablePointer
The logical representation of a position for the change in the transaction log.
|
ChangeEventSource.ChangeEventSourceContext| Modifier and Type | Field and Description |
|---|---|
private Clock |
clock |
private static int |
COL_COMMIT_LSN |
private static int |
COL_DATA |
private static int |
COL_OPERATION |
private static int |
COL_ROW_LSN |
private SqlServerConnection |
connection |
private SqlServerConnectorConfig |
connectorConfig |
private EventDispatcher<TableId> |
dispatcher |
private ErrorHandler |
errorHandler |
private static org.slf4j.Logger |
LOGGER |
private static Pattern |
MISSING_CDC_FUNCTION_CHANGES_ERROR |
private SqlServerOffsetContext |
offsetContext |
private Duration |
pollInterval |
private SqlServerDatabaseSchema |
schema |
| Constructor and Description |
|---|
SqlServerStreamingChangeEventSource(SqlServerConnectorConfig connectorConfig,
SqlServerOffsetContext offsetContext,
SqlServerConnection connection,
EventDispatcher<TableId> dispatcher,
ErrorHandler errorHandler,
Clock clock,
SqlServerDatabaseSchema schema) |
| Modifier and Type | Method and Description |
|---|---|
void |
commitOffset(Map<String,?> offset) |
void |
execute(ChangeEventSource.ChangeEventSourceContext context) |
private ChangeTable[] |
getCdcTablesToQuery() |
private void |
migrateTable(Queue<ChangeTable> schemaChangeCheckpoints) |
private ChangeTable[] |
processErrorFromChangeTableQuery(SQLException exception,
ChangeTable[] currentChangeTables) |
private static final int COL_COMMIT_LSN
private static final int COL_ROW_LSN
private static final int COL_OPERATION
private static final int COL_DATA
private static final Pattern MISSING_CDC_FUNCTION_CHANGES_ERROR
private static final org.slf4j.Logger LOGGER
private final SqlServerConnection connection
private final EventDispatcher<TableId> dispatcher
private final ErrorHandler errorHandler
private final Clock clock
private final SqlServerDatabaseSchema schema
private final SqlServerOffsetContext offsetContext
private final Duration pollInterval
private final SqlServerConnectorConfig connectorConfig
public SqlServerStreamingChangeEventSource(SqlServerConnectorConfig connectorConfig, SqlServerOffsetContext offsetContext, SqlServerConnection connection, EventDispatcher<TableId> dispatcher, ErrorHandler errorHandler, Clock clock, SqlServerDatabaseSchema schema)
public void execute(ChangeEventSource.ChangeEventSourceContext context) throws InterruptedException
execute in interface StreamingChangeEventSourceInterruptedExceptionprivate void migrateTable(Queue<ChangeTable> schemaChangeCheckpoints) throws InterruptedException, SQLException
InterruptedExceptionSQLExceptionprivate ChangeTable[] processErrorFromChangeTableQuery(SQLException exception, ChangeTable[] currentChangeTables) throws Exception
Exceptionprivate ChangeTable[] getCdcTablesToQuery() throws SQLException, InterruptedException
SQLExceptionInterruptedExceptionpublic void commitOffset(Map<String,?> offset)
commitOffset in interface StreamingChangeEventSourceCopyright © 2019 JBoss by Red Hat. All rights reserved.