public interface Heartbeat
heartbeat(Map, Map, BlockingConsumer) from a main loop of a connector.| Modifier and Type | Interface and Description |
|---|---|
static interface |
Heartbeat.OffsetProducer
Returns the offset to be used when emitting a heartbeat event.
|
| Modifier and Type | Field and Description |
|---|---|
static Heartbeat |
DEFAULT_NOOP_HEARTBEAT
No-op Heartbeat implementation
|
static Field |
HEARTBEAT_INTERVAL |
static String |
HEARTBEAT_INTERVAL_PROPERTY_NAME |
static Field |
HEARTBEAT_TOPICS_PREFIX |
| Modifier and Type | Method and Description |
|---|---|
static Heartbeat |
create(Duration heartbeatInterval,
String topicName,
String key)
Provide an instance of Heartbeat object
|
static Heartbeat |
create(Duration heartbeatInterval,
String heartbeatQuery,
String topicName,
String key,
JdbcConnection jdbcConnection,
HeartbeatErrorHandler errorHandler) |
void |
forcedBeat(Map<String,?> partition,
Map<String,?> offset,
BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer)
Generates a heartbeat record unconditionaly
|
void |
heartbeat(Map<String,?> partition,
Heartbeat.OffsetProducer offsetProducer,
BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer)
Generates a heartbeat record if defined time has elapsed
|
void |
heartbeat(Map<String,?> partition,
Map<String,?> offset,
BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer)
Generates a heartbeat record if defined time has elapsed
|
boolean |
isEnabled()
Whether heartbeats are enabled or not.
|
static final String HEARTBEAT_INTERVAL_PROPERTY_NAME
static final Field HEARTBEAT_INTERVAL
static final Field HEARTBEAT_TOPICS_PREFIX
static final Heartbeat DEFAULT_NOOP_HEARTBEAT
void heartbeat(Map<String,?> partition, Map<String,?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) throws InterruptedException
partition - partition for the heartbeat recordoffset - offset for the heartbeat recordconsumer - - a code to place record among others to be sent into ConnectInterruptedExceptionvoid heartbeat(Map<String,?> partition, Heartbeat.OffsetProducer offsetProducer, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) throws InterruptedException
partition - partition for the heartbeat recordoffsetProducer - lazily calculated offset for the heartbeat recordconsumer - - a code to place record among others to be sent into ConnectInterruptedExceptionvoid forcedBeat(Map<String,?> partition, Map<String,?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) throws InterruptedException
partition - partition for the heartbeat recordoffset - offset for the heartbeat recordconsumer - - a code to place record among others to be sent into ConnectInterruptedExceptionboolean isEnabled()
static Heartbeat create(Duration heartbeatInterval, String topicName, String key)
heartbeatInterval - heartbeat interval config value as java.time.DurationtopicName - topic to which the heartbeat messages will be sentkey - kafka partition key to use for the heartbeat messagestatic Heartbeat create(Duration heartbeatInterval, String heartbeatQuery, String topicName, String key, JdbcConnection jdbcConnection, HeartbeatErrorHandler errorHandler)
Copyright © 2021 JBoss by Red Hat. All rights reserved.