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 client (4xx), server (5xx), shard-unavailable errors, and cancellation errors. To limit memory usage, this class collects only the first 10 exceptions in each category by default. When returning the accumulated failures to the caller, this class prefers client (4xx) errors over server (5xx) errors, shard-unavailable errors, and cancellation errors, as they are more useful for diagnosing issues.
  • Constructor Details

    • FailureCollector

      public FailureCollector()
    • FailureCollector

      public FailureCollector(int maxExceptions)
  • Method Details

    • unwrapTransportException

      public static Exception unwrapTransportException(TransportException te)
    • 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 client (4xx) errors over server (5xx) errors and cancellation errors, as they are more useful for diagnosing issues. Once this method builds the failure, incoming failures are discarded.
      Returns:
      the accumulated failure, or null if no failure has been collected