Class FailureCollector

java.lang.Object
org.elasticsearch.compute.operator.FailureCollector

public final class FailureCollector extends Object
FailureCollector is responsible for collecting exceptions that occur in the compute engine. The collected exceptions are categorized into task-cancelled and non-task-cancelled exceptions. To limit memory usage, this class collects only the first 10 exceptions in each category by default. When returning the accumulated failure to the caller, this class prefers non-task-cancelled exceptions over task-cancelled ones as they are more useful for diagnosing issues.
  • Constructor Details

    • FailureCollector

      public FailureCollector()
    • FailureCollector

      public FailureCollector(int maxExceptions)
  • Method Details

    • unwrapAndCollect

      public void unwrapAndCollect(Exception e)
    • hasFailure

      public boolean hasFailure()
      Returns:
      true if any failure has been collected, false otherwise
    • getFailure

      public Exception getFailure()
      Returns the accumulated failure, preferring non-task-cancelled exceptions over task-cancelled ones. Once this method builds the failure, incoming failures are discarded.
      Returns:
      the accumulated failure, or null if no failure has been collected