Interface ConcurrentDocumentFetcherScanner
-
- All Known Subinterfaces:
ConcurrentScannerThrottlingAware
public interface ConcurrentDocumentFetcherScanner
This interface is implemented by the scanner if it wants to take advantage of the platform's concurrent scanner support. it allows the user to configure different aspects (e.g pool size and timeout values) of concurrent scanning. It also allow the connector framework to pass the scanner a ConcurrentProvider object the scanner will use to queueDocumentFetchRequest
requests. It will also allow the connector framework to stop the scanner through thestop()
call.If the scanner implements this interface it cannot feed document directly from the publisher, it will have to use the
ConcurrencyProvider
. Other publisher method such as delete will still be allowed.
-
-
Field Summary
Fields Modifier and Type Field Description static long
FETCHER_TIMEOUT_DEFAULT
static int
THREADPOOL_SIZE_DEFAULT
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default long
getFetcherTimeout()
Gets a timeout for the fetcher.default int
getThreadpoolSize()
Gets the number of threads to use by fetch tasks.void
setConcurrencyProvider(ConcurrencyProvider concurrencyProvider)
Sets the concurrency provider.default void
setFetcherTimeout(long timeoutMillis)
Sets a timeout for the fetcher.default void
setThreadpoolSize(int threadPoolSize)
Sets the number of threads to use by fetch tasks.void
stop()
The stop call implementation should trigger the scanner to stop queuing new tasks and return from thestart
method.
-
-
-
Field Detail
-
FETCHER_TIMEOUT_DEFAULT
static final long FETCHER_TIMEOUT_DEFAULT
- See Also:
- Constant Field Values
-
THREADPOOL_SIZE_DEFAULT
static final int THREADPOOL_SIZE_DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
setFetcherTimeout
default void setFetcherTimeout(long timeoutMillis)
Sets a timeout for the fetcher. The fetcher will fail if couldn't get the content before the timeout expired- Parameters:
timeoutMillis
- the timeout in milliseconds
-
getFetcherTimeout
default long getFetcherTimeout()
Gets a timeout for the fetcher. The fetcher will fail if couldn't get the content before the timeout expired- Returns:
- the timeout in milliseconds
-
setThreadpoolSize
default void setThreadpoolSize(int threadPoolSize)
Sets the number of threads to use by fetch tasks.- Parameters:
threadPoolSize
-
-
getThreadpoolSize
default int getThreadpoolSize()
Gets the number of threads to use by fetch tasks.- Returns:
-
setConcurrencyProvider
void setConcurrencyProvider(ConcurrencyProvider concurrencyProvider)
Sets the concurrency provider. The scanner will use the concurrency provider to queue content fetchers.- Parameters:
concurrencyProvider
- the concurrency provider
-
stop
void stop()
The stop call implementation should trigger the scanner to stop queuing new tasks and return from thestart
method.
-
-