Package io.debezium.heartbeat
Class DatabaseHeartbeatImpl
- java.lang.Object
-
- io.debezium.heartbeat.HeartbeatImpl
-
- io.debezium.heartbeat.DatabaseHeartbeatImpl
-
- All Implemented Interfaces:
Heartbeat
public class DatabaseHeartbeatImpl extends HeartbeatImpl
Implementation of the heartbeat feature that allows for a DB query to be executed with every heartbeat.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.debezium.heartbeat.Heartbeat
Heartbeat.OffsetProducer
-
-
Field Summary
Fields Modifier and Type Field Description private HeartbeatErrorHandler
errorHandler
static Field
HEARTBEAT_ACTION_QUERY
static String
HEARTBEAT_ACTION_QUERY_PROPERTY_NAME
private String
heartBeatActionQuery
private JdbcConnection
jdbcConnection
private static org.slf4j.Logger
LOGGER
-
Fields inherited from class io.debezium.heartbeat.HeartbeatImpl
DEFAULT_HEARTBEAT_INTERVAL, DEFAULT_HEARTBEAT_TOPICS_PREFIX
-
Fields inherited from interface io.debezium.heartbeat.Heartbeat
DEFAULT_NOOP_HEARTBEAT, HEARTBEAT_INTERVAL, HEARTBEAT_INTERVAL_PROPERTY_NAME, HEARTBEAT_TOPICS_PREFIX
-
-
Constructor Summary
Constructors Constructor Description DatabaseHeartbeatImpl(Duration heartbeatInterval, String topicName, String key, JdbcConnection jdbcConnection, String heartBeatActionQuery, HeartbeatErrorHandler errorHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forcedBeat(Map<String,?> partition, Map<String,?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer)
Generates a heartbeat record unconditionaly-
Methods inherited from class io.debezium.heartbeat.HeartbeatImpl
heartbeat, heartbeat, isEnabled
-
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
HEARTBEAT_ACTION_QUERY_PROPERTY_NAME
public static final String HEARTBEAT_ACTION_QUERY_PROPERTY_NAME
- See Also:
- Constant Field Values
-
HEARTBEAT_ACTION_QUERY
public static final Field HEARTBEAT_ACTION_QUERY
-
heartBeatActionQuery
private final String heartBeatActionQuery
-
jdbcConnection
private final JdbcConnection jdbcConnection
-
errorHandler
private final HeartbeatErrorHandler errorHandler
-
-
Constructor Detail
-
DatabaseHeartbeatImpl
DatabaseHeartbeatImpl(Duration heartbeatInterval, String topicName, String key, JdbcConnection jdbcConnection, String heartBeatActionQuery, HeartbeatErrorHandler errorHandler)
-
-
Method Detail
-
forcedBeat
public void forcedBeat(Map<String,?> partition, Map<String,?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) throws InterruptedException
Description copied from interface:Heartbeat
Generates a heartbeat record unconditionaly- Specified by:
forcedBeat
in interfaceHeartbeat
- Overrides:
forcedBeat
in classHeartbeatImpl
- Parameters:
partition
- partition for the heartbeat recordoffset
- offset for the heartbeat recordconsumer
- - a code to place record among others to be sent into Connect- Throws:
InterruptedException
-
-