Class FailureEnricherUtils


  • public class FailureEnricherUtils
    extends Object
    Utils class for loading and running pluggable failure enrichers.
    • Constructor Detail

      • FailureEnricherUtils

        public FailureEnricherUtils()
    • Method Detail

      • getFailureEnrichers

        public static Collection<FailureEnricher> getFailureEnrichers​(Configuration configuration)
        Returns a set of validated FailureEnrichers for a given configuration.
        Parameters:
        configuration - the configuration for the job
        Returns:
        a collection of validated FailureEnrichers
      • labelFailure

        public static CompletableFuture<Map<String,​String>> labelFailure​(Throwable cause,
                                                                               FailureEnricher.Context context,
                                                                               Executor mainThreadExecutor,
                                                                               Collection<FailureEnricher> failureEnrichers)
        Enriches a Throwable by returning the merged label output of a Set of FailureEnrichers.
        Parameters:
        cause - the Throwable to label
        context - the context of the Throwable
        mainThreadExecutor - the executor to complete the enricher labeling on
        failureEnrichers - a collection of FailureEnrichers to enrich the context with
        Returns:
        a CompletableFuture that will complete with a map of labels