Package org.apache.tika.pipes.core
Class PipesClient
java.lang.Object
org.apache.tika.pipes.core.PipesClient
- All Implemented Interfaces:
Closeable,AutoCloseable
The PipesClient is designed to be single-threaded. It only allots
a single thread for
process(FetchEmitTuple) processing.
See AsyncProcessor for handling
multiple PipesClients.
PipesClient delegates server lifecycle management to a ServerManager.
In per-client mode, each client has its own PerClientServerManager.
In shared mode, all clients share a single SharedServerManager.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionPipesClient(PipesConfig pipesConfig, Path tikaConfigPath) Creates a PipesClient with its own dedicated server process.PipesClient(PipesConfig pipesConfig, ServerManager serverManager) Creates a PipesClient with the given server manager. -
Method Summary
-
Field Details
-
SOCKET_CONNECT_TIMEOUT_MS
public static final int SOCKET_CONNECT_TIMEOUT_MS- See Also:
-
SOCKET_TIMEOUT_MS
public static final int SOCKET_TIMEOUT_MS- See Also:
-
-
Constructor Details
-
PipesClient
Creates a PipesClient with the given server manager.The caller retains ownership of the server manager and is responsible for closing it. This is used in shared mode where multiple clients share a single server manager.
- Parameters:
pipesConfig- the pipes configurationserverManager- the server manager (per-client or shared)
-
PipesClient
Creates a PipesClient with its own dedicated server process.This is a convenience constructor for per-client mode that creates a
PerClientServerManagerinternally. The server will be started lazily on first use and shut down when this client is closed.- Parameters:
pipesConfig- the pipes configurationtikaConfigPath- path to the tika config file
-
-
Method Details
-
getFilesProcessed
public int getFilesProcessed() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getPipesClientId
public int getPipesClientId() -
process
- Throws:
IOExceptionInterruptedException
-