Heartbeat.OffsetProducer| Modifier and Type | Field and Description |
|---|---|
(package private) static int |
DEFAULT_HEARTBEAT_INTERVAL
Default length of interval in which connector generates periodically
heartbeat messages.
|
(package private) static String |
DEFAULT_HEARTBEAT_TOPICS_PREFIX
Default prefix for names of heartbeat topics
|
private Duration |
heartbeatInterval |
private Threads.Timer |
heartbeatTimeout |
private String |
key |
private static org.apache.kafka.connect.data.Schema |
KEY_SCHEMA |
private static org.slf4j.Logger |
LOGGER |
private static SchemaNameAdjuster |
schemaNameAdjuster |
private static String |
SERVER_NAME_KEY |
private String |
topicName |
private static org.apache.kafka.connect.data.Schema |
VALUE_SCHEMA |
HEARTBEAT_INTERVAL, HEARTBEAT_INTERVAL_PROPERTY_NAME, HEARTBEAT_TOPICS_PREFIX, NULL| Constructor and Description |
|---|
HeartbeatImpl(Configuration configuration,
String topicName,
String key) |
| Modifier and Type | Method and Description |
|---|---|
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
|
private org.apache.kafka.connect.source.SourceRecord |
heartbeatRecord(Map<String,?> sourcePartition,
Map<String,?> sourceOffset)
Produce an empty record to the heartbeat topic.
|
boolean |
isEnabled()
Whether heartbeats are enabled or not.
|
private org.apache.kafka.connect.data.Struct |
messageValue()
Produce a value struct containing the timestamp
|
private Threads.Timer |
resetHeartbeat() |
private org.apache.kafka.connect.data.Struct |
serverNameKey(String serverName)
Produce a key struct based on the server name and KEY_SCHEMA
|
private static final org.slf4j.Logger LOGGER
private static final SchemaNameAdjuster schemaNameAdjuster
static final int DEFAULT_HEARTBEAT_INTERVAL
static final String DEFAULT_HEARTBEAT_TOPICS_PREFIX
private static final String SERVER_NAME_KEY
private static org.apache.kafka.connect.data.Schema KEY_SCHEMA
private static org.apache.kafka.connect.data.Schema VALUE_SCHEMA
private final String topicName
private final Duration heartbeatInterval
private final String key
private volatile Threads.Timer heartbeatTimeout
HeartbeatImpl(Configuration configuration, String topicName, String key)
public void heartbeat(Map<String,?> partition, Map<String,?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) throws InterruptedException
Heartbeatheartbeat in interface Heartbeatpartition - partition for the heartbeat recordoffset - offset for the heartbeat recordconsumer - - a code to place record among others to be sent into ConnectInterruptedExceptionpublic void heartbeat(Map<String,?> partition, Heartbeat.OffsetProducer offsetProducer, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) throws InterruptedException
Heartbeatheartbeat in interface Heartbeatpartition - partition for the heartbeat recordoffsetProducer - lazily calculated offset for the heartbeat recordconsumer - - a code to place record among others to be sent into ConnectInterruptedExceptionpublic void forcedBeat(Map<String,?> partition, Map<String,?> offset, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) throws InterruptedException
HeartbeatforcedBeat in interface Heartbeatpartition - partition for the heartbeat recordoffset - offset for the heartbeat recordconsumer - - a code to place record among others to be sent into ConnectInterruptedExceptionpublic boolean isEnabled()
Heartbeatprivate org.apache.kafka.connect.data.Struct serverNameKey(String serverName)
private org.apache.kafka.connect.data.Struct messageValue()
private org.apache.kafka.connect.source.SourceRecord heartbeatRecord(Map<String,?> sourcePartition, Map<String,?> sourceOffset)
private Threads.Timer resetHeartbeat()
Copyright © 2020 JBoss by Red Hat. All rights reserved.