Class PipesIterator
java.lang.Object
org.apache.tika.config.ConfigBase
org.apache.tika.pipes.pipesiterator.PipesIterator
- All Implemented Interfaces:
Iterable<FetchEmitTuple>
,Callable<Integer>
,Initializable
- Direct Known Subclasses:
AZBlobPipesIterator
,CSVPipesIterator
,FileListPipesIterator
,FileSystemPipesIterator
,GCSPipesIterator
,JDBCPipesIterator
,JsonPipesIterator
,KafkaPipesIterator
,S3PipesIterator
,SolrPipesIterator
public abstract class PipesIterator
extends ConfigBase
implements Callable<Integer>, Iterable<FetchEmitTuple>, Initializable
Abstract class that handles the testing for timeouts/thread safety
issues. Concrete classes implement the blocking
enqueue()
.
If there's an exception in the enqueuing thread, this will throw
a RuntimeException. It will throw an IllegalStateException if
next() is called after hasNext() has returned false.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PipesIterator
call()
void
checkInitialization
(InitializableProblemHandler problemHandler) protected abstract void
enqueue()
protected HandlerConfig
void
initialize
(Map<String, Param> params) iterator()
void
setEmitterName
(String emitterName) void
setFetcherName
(String fetcherName) void
setHandlerType
(String handlerType) void
setMaxEmbeddedResources
(int maxEmbeddedResources) void
setMaxWaitMs
(long maxWaitMs) void
setOnParseException
(String onParseException) void
setOnParseException
(FetchEmitTuple.ON_PARSE_EXCEPTION onParseException) void
setParseMode
(String parseModeString) void
setParseMode
(HandlerConfig.PARSE_MODE parseMode) void
setQueueSize
(int queueSize) void
setThrowOnWriteLimitReached
(boolean throwOnWriteLimitReached) void
setWriteLimit
(int writeLimit) protected void
Methods inherited from class org.apache.tika.config.ConfigBase
buildComposite, buildComposite, buildSingle, buildSingle, configure, handleSettings
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
DEFAULT_MAX_WAIT_MS
public static final long DEFAULT_MAX_WAIT_MS- See Also:
-
DEFAULT_QUEUE_SIZE
public static final int DEFAULT_QUEUE_SIZE- See Also:
-
COMPLETED_SEMAPHORE
-
-
Constructor Details
-
PipesIterator
public PipesIterator()
-
-
Method Details
-
build
- Throws:
IOException
TikaConfigException
-
getFetcherName
-
setFetcherName
-
getEmitterName
-
setEmitterName
-
setMaxWaitMs
-
setQueueSize
-
getOnParseException
-
setOnParseException
- Throws:
TikaConfigException
-
setOnParseException
-
setHandlerType
-
setWriteLimit
-
setThrowOnWriteLimitReached
-
setMaxEmbeddedResources
-
setParseMode
-
setParseMode
-
call
-
getHandlerConfig
-
enqueue
-
tryToAdd
- Throws:
InterruptedException
TimeoutException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Parameters:
params
- params to use for initialization- Throws:
TikaConfigException
-
checkInitialization
public void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException - Specified by:
checkInitialization
in interfaceInitializable
- Parameters:
problemHandler
- if there is a problem and no custom initializableProblemHandler has been configured via Initializable parameters, this is called to respond.- Throws:
TikaConfigException
-
iterator
- Specified by:
iterator
in interfaceIterable<FetchEmitTuple>
-