public static enum FlinkKafkaProducer011.Semantic extends Enum<FlinkKafkaProducer011.Semantic>
| Enum Constant and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
static FlinkKafkaProducer011.Semantic |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FlinkKafkaProducer011.Semantic[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
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 - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.