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 blockingenqueue()
. 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
Fields Modifier and Type Field Description static FetchEmitTuple
COMPLETED_SEMAPHORE
static long
DEFAULT_MAX_WAIT_MS
static int
DEFAULT_QUEUE_SIZE
-
Constructor Summary
Constructors Constructor Description PipesIterator()
-
Method Summary
-
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 Detail
-
DEFAULT_MAX_WAIT_MS
public static final long DEFAULT_MAX_WAIT_MS
- See Also:
- Constant Field Values
-
DEFAULT_QUEUE_SIZE
public static final int DEFAULT_QUEUE_SIZE
- See Also:
- Constant Field Values
-
COMPLETED_SEMAPHORE
public static final FetchEmitTuple COMPLETED_SEMAPHORE
-
-
Method Detail
-
build
public static PipesIterator build(Path tikaConfigFile) throws IOException, TikaConfigException
- Throws:
IOException
TikaConfigException
-
getFetcherName
public String getFetcherName()
-
getEmitterName
public String getEmitterName()
-
setMaxWaitMs
@Field public void setMaxWaitMs(long maxWaitMs)
-
setQueueSize
@Field public void setQueueSize(int queueSize)
-
getOnParseException
public FetchEmitTuple.ON_PARSE_EXCEPTION getOnParseException()
-
setOnParseException
@Field public void setOnParseException(String onParseException) throws TikaConfigException
- Throws:
TikaConfigException
-
setOnParseException
public void setOnParseException(FetchEmitTuple.ON_PARSE_EXCEPTION onParseException)
-
setWriteLimit
@Field public void setWriteLimit(int writeLimit)
-
setThrowOnWriteLimitReached
@Field public void setThrowOnWriteLimitReached(boolean throwOnWriteLimitReached)
-
setMaxEmbeddedResources
@Field public void setMaxEmbeddedResources(int maxEmbeddedResources)
-
setParseMode
public void setParseMode(HandlerConfig.PARSE_MODE parseMode)
-
getHandlerConfig
protected HandlerConfig getHandlerConfig()
-
enqueue
protected abstract void enqueue() throws IOException, TimeoutException, InterruptedException
-
tryToAdd
protected void tryToAdd(FetchEmitTuple p) throws InterruptedException, TimeoutException
- Throws:
InterruptedException
TimeoutException
-
initialize
public void initialize(Map<String,Param> params) throws TikaConfigException
- 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
public Iterator<FetchEmitTuple> iterator()
- Specified by:
iterator
in interfaceIterable<FetchEmitTuple>
-
-