public static enum FlinkKafkaProducer.Semantic extends Enum<FlinkKafkaProducer.Semantic>
| 枚举常量和说明 |
|---|
AT_LEAST_ONCE
Semantic.AT_LEAST_ONCE the Flink producer will wait for all outstanding messages in the
Kafka buffers to be acknowledged by the Kafka producer on a checkpoint.
|
EXACTLY_ONCE
Semantic.EXACTLY_ONCE the Flink producer will write all messages in a Kafka transaction
that will be committed to Kafka on a checkpoint.
|
NONE
Semantic.NONE means that nothing will be guaranteed.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static FlinkKafkaProducer.Semantic |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。
|
static FlinkKafkaProducer.Semantic[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final FlinkKafkaProducer.Semantic EXACTLY_ONCE
In this mode FlinkKafkaProducer sets up a pool of FlinkKafkaInternalProducer. Between each checkpoint a Kafka transaction is created,
which is committed on TwoPhaseCommitSinkFunction.notifyCheckpointComplete(long). If
checkpoint complete notifications are running late, FlinkKafkaProducer can run
out of FlinkKafkaInternalProducers in the pool. In that case any subsequent
FlinkKafkaProducer.snapshotState(FunctionSnapshotContext) requests will fail and
FlinkKafkaProducer will keep using the FlinkKafkaInternalProducer from
the previous checkpoint. To decrease the chance of failing checkpoints there are four
options:
FlinkKafkaInternalProducers poolpublic static final FlinkKafkaProducer.Semantic AT_LEAST_ONCE
public static final FlinkKafkaProducer.Semantic NONE
public static FlinkKafkaProducer.Semantic[] values()
for (FlinkKafkaProducer.Semantic c : FlinkKafkaProducer.Semantic.values()) System.out.println(c);
public static FlinkKafkaProducer.Semantic valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.