Package io.debezium.heartbeat
Interface Heartbeat
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
DatabaseHeartbeatImpl,HeartbeatImpl
A class that is able to generate periodic heartbeat messages based on a pre-configured interval. The clients are
supposed to call method
heartbeat(Map, Map, BlockingConsumer) from a main loop of a connector.- Author:
- Jiri Pechanec
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceReturns the offset to be used when emitting a heartbeat event. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()voidforcedBeat(Map<String, ?> partition, Map<String, ?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) Generates a heartbeat record unconditionalyvoidheartbeat(Map<String, ?> partition, Heartbeat.OffsetProducer offsetProducer, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) Generates a heartbeat record if defined time has elapsedvoidheartbeat(Map<String, ?> partition, Map<String, ?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) Generates a heartbeat record if defined time has elapsedbooleanWhether heartbeats are enabled or not.
-
Field Details
-
HEARTBEAT_INTERVAL_PROPERTY_NAME
- See Also:
-
HEARTBEAT_INTERVAL
-
HEARTBEAT_TOPICS_PREFIX
-
DEFAULT_NOOP_HEARTBEAT
No-op Heartbeat implementation
-
-
Method Details
-
heartbeat
void heartbeat(Map<String, ?> partition, Map<String, throws InterruptedException?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) Generates a heartbeat record if defined time has elapsed- 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
-
heartbeat
void heartbeat(Map<String, ?> partition, Heartbeat.OffsetProducer offsetProducer, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) throws InterruptedExceptionGenerates a heartbeat record if defined time has elapsed- Parameters:
partition- partition for the heartbeat recordoffsetProducer- lazily calculated offset for the heartbeat recordconsumer- - a code to place record among others to be sent into Connect- Throws:
InterruptedException
-
forcedBeat
void forcedBeat(Map<String, ?> partition, Map<String, throws InterruptedException?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) Generates a heartbeat record unconditionaly- 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
-
isEnabled
boolean isEnabled()Whether heartbeats are enabled or not. -
close
default void close()- Specified by:
closein interfaceAutoCloseable
-