public interface Heartbeat
#heartbeat(Consumer) 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 Field |
HEARTBEAT_INTERVAL |
static String |
HEARTBEAT_INTERVAL_PROPERTY_NAME |
static Field |
HEARTBEAT_TOPICS_PREFIX |
static Heartbeat |
NULL
No-op Heartbeat implementation
|
| Modifier and Type | Method and Description |
|---|---|
static Heartbeat |
create(Configuration configuration,
String topicName,
String key)
Provide an instance of Heartbeat object
|
static Heartbeat |
create(Configuration configuration,
String topicName,
String key,
JdbcConnection jdbcConnection)
Provide an instance of Heartbeat object
|
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 NULL
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(Configuration configuration, String topicName, String key)
configuration - connector configurationtopicName - topic to which the heartbeat messages will be sentkey - kafka partition key to use for the heartbeat messagestatic Heartbeat create(Configuration configuration, String topicName, String key, JdbcConnection jdbcConnection)
configuration - connector configurationtopicName - topic to which the heartbeat messages will be sentkey - kafka partition key to use for the heartbeat messagejdbcConnection - a database connectionCopyright © 2020 JBoss by Red Hat. All rights reserved.