接口 KafkaProduceSender<K,V>
-
- 所有超级接口:
AutoCloseable
public interface KafkaProduceSender<K,V> extends AutoCloseable
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidabortTransaction()Abort the current transaction.voidabortTransaction(long checkpointId)Abort the given transaction.voidbeginTransaction(String transactionId)Optional<KafkaCommitInfo>prepareCommit()Prepare a transaction commit.voidsend(org.apache.kafka.clients.producer.ProducerRecord<K,V> producerRecord)Send data to kafka.List<KafkaSinkState>snapshotState(long checkpointId)Get the current kafka state of the sender.-
从接口继承的方法 java.lang.AutoCloseable
close
-
-
-
-
方法详细资料
-
send
void send(org.apache.kafka.clients.producer.ProducerRecord<K,V> producerRecord)
Send data to kafka.- 参数:
producerRecord- data to send
-
beginTransaction
void beginTransaction(String transactionId)
-
prepareCommit
Optional<KafkaCommitInfo> prepareCommit()
Prepare a transaction commit.- 返回:
- commit info, or empty if no commit is needed.
-
abortTransaction
void abortTransaction()
Abort the current transaction.
-
abortTransaction
void abortTransaction(long checkpointId)
Abort the given transaction.- 参数:
checkpointId- the id of the last checkpoint of the last run
-
snapshotState
List<KafkaSinkState> snapshotState(long checkpointId)
Get the current kafka state of the sender.- 返回:
- kafka state List, or empty if no state is available.
-
-