Package org.apache.tika.batch
Class ConsumersManager
java.lang.Object
org.apache.tika.batch.ConsumersManager
- Direct Known Subclasses:
DBConsumersManager,FSConsumersManager
Simple interface around a collection of consumers that allows
for initializing and shutting shared resources (e.g. db connection, index, writer, etc.)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the consumerslongBatchProcesswill throw an exception if the ConsumersManager doesn't complete init() or shutdown() within this amount of time.voidinit()This is called by BatchProcess before submitting the threadsvoidsetConsumersManagerMaxMillis(long consumersManagerMaxMillis) voidshutdown()This is called by BatchProcess immediately before closing.
-
Constructor Details
-
ConsumersManager
-
-
Method Details
-
getConsumers
Get the consumers- Returns:
- consumers
-
init
public void init()This is called by BatchProcess before submitting the threads -
shutdown
public void shutdown()This is called by BatchProcess immediately before closing. Beware! Some of the consumers may have hung or may not have completed. -
getConsumersManagerMaxMillis
public long getConsumersManagerMaxMillis()BatchProcesswill throw an exception if the ConsumersManager doesn't complete init() or shutdown() within this amount of time.- Returns:
- the maximum time allowed for init() or shutdown()
-
setConsumersManagerMaxMillis
public void setConsumersManagerMaxMillis(long consumersManagerMaxMillis) - Parameters:
consumersManagerMaxMillis- maximum number of milliseconds to allow for init() or shutdown()- See Also:
-