Package io.debezium.heartbeat
Class DatabaseHeartbeatImpl
java.lang.Object
io.debezium.heartbeat.DatabaseHeartbeatImpl
- All Implemented Interfaces:
Heartbeat,AutoCloseable
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, Heartbeat.ScheduledHeartbeat -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HeartbeatErrorHandlerstatic final io.debezium.config.Fieldstatic final Stringprivate final Stringprivate final JdbcConnectionprivate static final org.slf4j.LoggerFields inherited from interface io.debezium.heartbeat.Heartbeat
DEFAULT_NOOP_HEARTBEAT, HEARTBEAT_INTERVAL, HEARTBEAT_INTERVAL_PROPERTY_NAME, HEARTBEAT_TOPICS_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionDatabaseHeartbeatImpl(JdbcConnection jdbcConnection, String heartBeatActionQuery, HeartbeatErrorHandler errorHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidemit(Map<String, ?> partition, OffsetContext offset) Generates a heartbeat record unconditionallyvoidforcedBeat(Map<String, ?> partition, Map<String, ?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) Generates a heartbeat record unconditionally Replaced byHeartbeat.emit(Map, OffsetContext)booleanWhether heartbeats are enabled or not.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
HEARTBEAT_ACTION_QUERY_PROPERTY_NAME
- See Also:
-
HEARTBEAT_ACTION_QUERY
public static final io.debezium.config.Field HEARTBEAT_ACTION_QUERY -
heartBeatActionQuery
-
jdbcConnection
-
errorHandler
-
-
Constructor Details
-
DatabaseHeartbeatImpl
public DatabaseHeartbeatImpl(JdbcConnection jdbcConnection, String heartBeatActionQuery, HeartbeatErrorHandler errorHandler)
-
-
Method Details
-
isEnabled
public boolean isEnabled()Description copied from interface:HeartbeatWhether heartbeats are enabled or not. -
forcedBeat
public void forcedBeat(Map<String, ?> partition, Map<String, ?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) Description copied from interface:HeartbeatGenerates a heartbeat record unconditionally Replaced byHeartbeat.emit(Map, OffsetContext)- Specified by:
forcedBeatin interfaceHeartbeat- Parameters:
partition- partition for the heartbeat recordoffset- offset for the heartbeat recordconsumer- - a code to place record among others to be sent into Connect
-
emit
Description copied from interface:HeartbeatGenerates a heartbeat record unconditionally- Specified by:
emitin interfaceHeartbeat- Parameters:
partition- partition for the heartbeat recordoffset- offset for the heartbeat record- Throws:
InterruptedException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceHeartbeat
-