Class TikaTimeoutException

All Implemented Interfaces:
Serializable

public class TikaTimeoutException extends TikaException
Thrown when a single operation (external process, HTTP call, pool borrow, etc.) exceeds its allotted timeout.

Checked, not a RuntimeException: expected to be caught at the nearest embedded-document boundary (see ParsingEmbeddedDocumentExtractor), recorded, and parsing of remaining siblings continued. This differs from the task's total deadline being exhausted, which does not throw at all -- see ParseRecord's taskDeadlineReached handling.

When the caller got its budget via ParseTimeout.budgetFor(long), use TikaTimeoutException(String, long, long) so the message states both the requested and granted budget: granted == requested means the operation's own timeout was binding; granted < requested means the task's total timeout was binding and raising the operation's timeout won't help.

Since:
Apache Tika 4.0
See Also:
  • Constructor Details

    • TikaTimeoutException

      public TikaTimeoutException(String message)
    • TikaTimeoutException

      public TikaTimeoutException(String message, long requestedMillis, long grantedMillis)
      Parameters:
      requestedMillis - the timeout the caller's own configuration asked for
      grantedMillis - the budget actually granted, e.g. by ParseTimeout.budgetFor
  • Method Details

    • getRequestedMillis

      public long getRequestedMillis()
      Returns:
      the timeout the caller's own configuration requested, or -1 if this exception was not constructed with that information
    • getGrantedMillis

      public long getGrantedMillis()
      Returns:
      the budget actually granted, or -1 if this exception was not constructed with that information
    • isClippedByRemaining

      public boolean isClippedByRemaining()
      Returns:
      true if the granted budget was clipped below the requested timeout by the task's remaining time (the task's total timeout was binding, not the operation's own). False -- including when no requested/granted info was recorded -- means the operation's own timeout was binding.