Class MssqlCdcSource

java.lang.Object
org.gridgain.internal.cdc.source.mssql.MssqlCdcSource
All Implemented Interfaces:
AutoCloseable, org.gridgain.internal.cdc.api.source.CdcSource

public class MssqlCdcSource extends Object implements org.gridgain.internal.cdc.api.source.CdcSource
Experimental CdcSource that reads change events from Microsoft SQL Server's native Change Data Capture.

For each replicated table a TablePoller on its own thread polls the table's capture instance (cdc.fn_cdc_get_all_changes_<instance>) over advancing LSN windows, maps each change row to a TableRowEvent, and pushes batches stamped with the upper-bound LSN as the resume watermark. In CdcReplicationMode.ALL mode an initial snapshot of existing rows (emitted as TableRowEventType.CREATED) precedes incremental polling. A lost connection is re-established with backoff (see the reconnect* parameters in MssqlSourceParameters); a saved position that CDC retention has discarded fails the table's replication with a message naming the recovery.

Captured columns with unmapped types (for example sql_variant or xml) fail at start rather than passing raw driver objects downstream; see MssqlTypeMapping.

Experimental limitations: the ALL-mode snapshot is not transactionally consistent with the start LSN for concurrently-modified rows; capture-instance names default to <schema>_<table> with no per-table override yet.

  • Constructor Summary

    Constructors
    Constructor
    Description
    MssqlCdcSource(org.gridgain.internal.cdc.api.source.SourceDefinition source)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    start(org.gridgain.internal.cdc.api.source.SourceTableDefinition table, byte @Nullable [] lastWatermark, org.gridgain.internal.cdc.api.replication.CdcReplicationMode mode, Flow.Subscriber<org.gridgain.internal.cdc.api.source.WatermarkedBatch> subscriber)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MssqlCdcSource

      public MssqlCdcSource(org.gridgain.internal.cdc.api.source.SourceDefinition source)
      Constructor.
      Parameters:
      source - Source definition whose parameters describe the SQL Server connection.
  • Method Details

    • start

      public void start(org.gridgain.internal.cdc.api.source.SourceTableDefinition table, byte @Nullable [] lastWatermark, org.gridgain.internal.cdc.api.replication.CdcReplicationMode mode, Flow.Subscriber<org.gridgain.internal.cdc.api.source.WatermarkedBatch> subscriber)
      Specified by:
      start in interface org.gridgain.internal.cdc.api.source.CdcSource
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable