Enum TransactionAbortStrategyImpl
- java.lang.Object
-
- java.lang.Enum<TransactionAbortStrategyImpl>
-
- org.apache.flink.connector.kafka.sink.internal.TransactionAbortStrategyImpl
-
- All Implemented Interfaces:
Serializable,Comparable<TransactionAbortStrategyImpl>
@Internal public enum TransactionAbortStrategyImpl extends Enum<TransactionAbortStrategyImpl>
Implementations of an abort strategy for transactions left over from previous runs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTransactionAbortStrategyImpl.ContextContext for theTransactionAbortStrategyImpl.static interfaceTransactionAbortStrategyImpl.TransactionAborterInjects the actual abortion of the transactional id generated by one of the strategies.
-
Enum Constant Summary
Enum Constants Enum Constant Description LISTINGPROBINGThe probing strategy starts with aborting a set of known transactional ids from the recovered state and then continues guessing if more transactions may have been opened between this run and the last successful checkpoint.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidabortTransactions(TransactionAbortStrategyImpl.Context context)Aborts all transactions that have been created by this subtask in a previous run.static TransactionAbortStrategyImplvalueOf(String name)Returns the enum constant of this type with the specified name.static TransactionAbortStrategyImpl[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PROBING
public static final TransactionAbortStrategyImpl PROBING
The probing strategy starts with aborting a set of known transactional ids from the recovered state and then continues guessing if more transactions may have been opened between this run and the last successful checkpoint. This also accounts for rescaling in between the attempts.However, the probing is not side-effect free, which leads to an ever-increasing search space for the next probing attempt in case of a restart loop. It will fix eventually on the next successful checkpoints. It's recommended to use this strategy only with a strict restart policy that prevents tight restart loops (e.g. incremental backoff or hard failure after X attempts).
This is exactly the same behavior as in flink-connector-kafka 3.X.
-
LISTING
public static final TransactionAbortStrategyImpl LISTING
-
-
Method Detail
-
values
public static TransactionAbortStrategyImpl[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TransactionAbortStrategyImpl c : TransactionAbortStrategyImpl.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TransactionAbortStrategyImpl valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
abortTransactions
public abstract void abortTransactions(TransactionAbortStrategyImpl.Context context)
Aborts all transactions that have been created by this subtask in a previous run.
-
-