Class 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 from DebeziumEngine to 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 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 Exception
        Take a snapshot of the Debezium handler state.

        Important: This method must be called under the checkpoint lock.

        Throws:
        Exception
      • runFetchLoop

        public void runFetchLoop()
                          throws Exception
        Process change messages from the Handover and collect the processed messages by Collector.
        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()