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