Package org.apache.tika.config
Class TikaProgressTracker
java.lang.Object
org.apache.tika.config.TikaProgressTracker
Tracks parse progress for the two-tier timeout system.
Parsers call update(ParseContext) after completing a unit of work
(e.g., finishing an external process for one page of OCR). The monitoring loop
reads getLastProgressMillis() to detect stalled parsers.
This is runtime-only state (NOT Serializable) — it is placed into
ParseContext on the server side before submitting a parse task
and is never sent over the wire.
- Since:
- Apache Tika 4.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the epoch millis of the last progress update.voidupdate()Signals progress directly on this tracker instance.static voidupdate(ParseContext context) Signals progress from a ParseContext.
-
Constructor Details
-
TikaProgressTracker
public TikaProgressTracker()Creates a tracker initialized to the current time.
-
-
Method Details
-
update
Signals progress from a ParseContext. If no tracker is present, this is a no-op.This is the preferred way for parsers to signal progress:
TikaProgressTracker.update(context);
- Parameters:
context- the ParseContext (may be null)
-
update
public void update()Signals progress directly on this tracker instance. -
getLastProgressMillis
public long getLastProgressMillis()Returns the epoch millis of the last progress update.- Returns:
- epoch millis of last progress
-