Class CustomTestFailureEnricher
- java.lang.Object
-
- org.apache.flink.runtime.enricher.CustomTestFailureEnricher
-
- All Implemented Interfaces:
FailureEnricher
public class CustomTestFailureEnricher extends Object implements FailureEnricher
The custom enricher for test.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.core.failure.FailureEnricher
FailureEnricher.Context
-
-
Constructor Summary
Constructors Constructor Description CustomTestFailureEnricher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getOutputKeys()
Method to list all the label Keys the enricher can associate with Values in case of a failureprocessFailure
.CompletableFuture<Map<String,String>>
processFailure(Throwable cause, FailureEnricher.Context context)
Method to handle a failure as part of the enricher and optionally return a map of KV pairs (labels).
-
-
-
Method Detail
-
getOutputKeys
public Set<String> getOutputKeys()
Description copied from interface:FailureEnricher
Method to list all the label Keys the enricher can associate with Values in case of a failureprocessFailure
. Note that Keys must unique and properly defined per enricher implementation otherwise will be ignored.- Specified by:
getOutputKeys
in interfaceFailureEnricher
- Returns:
- the unique label Keys of the FailureEnricher
-
processFailure
public CompletableFuture<Map<String,String>> processFailure(Throwable cause, FailureEnricher.Context context)
Description copied from interface:FailureEnricher
Method to handle a failure as part of the enricher and optionally return a map of KV pairs (labels). Note that Values should only be associated with Keys fromgetOutputKeys
method otherwise will be ignored.- Specified by:
processFailure
in interfaceFailureEnricher
- Parameters:
cause
- the exception that caused this failurecontext
- the context that includes extra information (e.g., if it was a global failure)- Returns:
- map of KV pairs (labels) associated with the failure
-
-