Class DebeziumChangeFetcher<T>
- java.lang.Object
-
- org.apache.flink.cdc.debezium.internal.DebeziumChangeFetcher<T>
-
- Type Parameters:
T- The type of elements produced by the handler.
@Internal public class DebeziumChangeFetcher<T> extends Object
A Handler that convert change messages fromDebeziumEngineto data in Flink. Considering Debezium in different mode has different strategies to hold the lock, e.g. snapshot, the handler also needs different strategy. In snapshot phase, the handler needs to hold the lock until the snapshot finishes. But in non-snapshot phase, the handler only needs to hold the lock when emitting the records.
-
-
Constructor Summary
Constructors Constructor Description DebeziumChangeFetcher(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<T> sourceContext, DebeziumDeserializationSchema<T> deserialization, boolean isInDbSnapshotPhase, String heartbeatTopicPrefix, Handover handover)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longgetEmitDelay()The metric indicates delay from data generation to leaving the source operator.longgetFetchDelay()The metric indicates delay from data generation to entry into the system.longgetIdleTime()longgetNumRecordInErrors()voidrunFetchLoop()Process change messages from theHandoverand collect the processed messages byCollector.byte[]snapshotCurrentState()Take a snapshot of the Debezium handler state.
-
-
-
Constructor Detail
-
DebeziumChangeFetcher
public DebeziumChangeFetcher(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<T> sourceContext, DebeziumDeserializationSchema<T> deserialization, boolean isInDbSnapshotPhase, String heartbeatTopicPrefix, Handover handover)
-
-
Method Detail
-
snapshotCurrentState
public byte[] snapshotCurrentState() throws ExceptionTake a snapshot of the Debezium handler state.Important: This method must be called under the checkpoint lock.
- Throws:
Exception
-
runFetchLoop
public void runFetchLoop() throws ExceptionProcess change messages from theHandoverand collect the processed messages byCollector.- Throws:
Exception
-
close
public void close()
-
getFetchDelay
public long getFetchDelay()
The metric indicates delay from data generation to entry into the system.Note: the metric is available during the binlog phase. Use 0 to indicate the metric is unavailable.
-
getEmitDelay
public long getEmitDelay()
The metric indicates delay from data generation to leaving the source operator.Note: the metric is available during the binlog phase. Use 0 to indicate the metric is unavailable.
-
getIdleTime
public long getIdleTime()
-
getNumRecordInErrors
public long getNumRecordInErrors()
-
-