Package org.apache.tika.server.core
Class ServerStatus
java.lang.Object
org.apache.tika.server.core.ServerStatus
Read-only server status for tracking active tasks and statistics.
This class provides observability into server activity. With pipes-based parsing, timeouts and process crashes are handled by the pipes infrastructure, so this class no longer triggers server shutdowns.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete(long taskId) Removes the task from the collection of currently running tasks.longReturns the total number of tasks started since server startup.longReturns milliseconds since the last task was started.getTasks()Returns a snapshot of currently running tasks.longstart(ServerStatus.TASK task, String fileName) Records the start of a task and returns a task ID for tracking.
-
Constructor Details
-
ServerStatus
public ServerStatus()
-
-
Method Details
-
start
Records the start of a task and returns a task ID for tracking.- Parameters:
task- the type of taskfileName- the file being processed (for diagnostics)- Returns:
- the task ID
-
complete
Removes the task from the collection of currently running tasks.- Parameters:
taskId- the task ID returned from start()- Throws:
IllegalArgumentException- if there is no task by that taskId
-
getTasks
Returns a snapshot of currently running tasks. -
getFilesProcessed
public long getFilesProcessed()Returns the total number of tasks started since server startup. -
getMillisSinceLastParseStarted
public long getMillisSinceLastParseStarted()Returns milliseconds since the last task was started.
-