Interface CdcSource
- All Superinterfaces:
AutoCloseable
WatermarkedBatches.
A source instance is created per replication via a source factory keyed on SourceType, and start(org.gridgain.internal.cdc.api.source.SourceTableDefinition, byte[], org.gridgain.internal.cdc.api.replication.CdcReplicationMode, java.util.concurrent.Flow.Subscriber<org.gridgain.internal.cdc.api.source.WatermarkedBatch>)
is invoked once per replicated table. Implementations own all source-side resources (connections, continuous-query
views, poller threads) and release them in AutoCloseable.close().
-
Method Summary
Modifier and TypeMethodDescriptionvoidstart(SourceTableDefinition table, byte @Nullable [] lastWatermark, CdcReplicationMode mode, Flow.Subscriber<WatermarkedBatch> subscriber) Begins streaming change events for a single table tosubscriber.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
start
void start(SourceTableDefinition table, byte @Nullable [] lastWatermark, CdcReplicationMode mode, Flow.Subscriber<WatermarkedBatch> subscriber) Begins streaming change events for a single table tosubscriber.The implementation calls
Flow.Subscriber.onSubscribe(java.util.concurrent.Flow.Subscription)with a subscription whosecancel()stops the stream, then pushesWatermarkedBatches viaFlow.Subscriber.onNext(T). Each batch carries the watermark the source assigns to it.Each event's (key, value) tuple pair must be split by the source table's primary key: the key tuple holds exactly the key columns and the value tuple only the remaining columns. Sinks write the pair through key-value views, which reject value tuples that repeat key columns.
- Parameters:
table- The table to read changes from.lastWatermark- The watermark to resume after, ornullto start according tomode.mode- The replication mode (e.g. only new data, or all existing data first).subscriber- The subscriber that consumes the produced batches.
-