Package org.apache.tika.batch.builders
Class BatchProcessBuilder
- java.lang.Object
-
- org.apache.tika.batch.builders.BatchProcessBuilder
-
public class BatchProcessBuilder extends Object
Builds a BatchProcessor from a combination of runtime arguments and the config file.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_QUEUE_SIZE
static String
MAX_QUEUE_SIZE_KEY
static String
NUM_CONSUMERS_KEY
-
Constructor Summary
Constructors Constructor Description BatchProcessBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BatchProcess
build(InputStream is, Map<String,String> runtimeAttributes)
Builds a BatchProcess from runtime arguments and a input stream of a configuration file.BatchProcess
build(Node docElement, Map<String,String> incomingRuntimeAttributes)
Builds a FileResourceBatchProcessor from runtime arguments and a document node of a configuration file.static int
getNumConsumers(Map<String,String> attrs)
numConsumers is needed by both the crawler and the consumers.
-
-
-
Field Detail
-
DEFAULT_MAX_QUEUE_SIZE
public static final int DEFAULT_MAX_QUEUE_SIZE
- See Also:
- Constant Field Values
-
MAX_QUEUE_SIZE_KEY
public static final String MAX_QUEUE_SIZE_KEY
- See Also:
- Constant Field Values
-
NUM_CONSUMERS_KEY
public static final String NUM_CONSUMERS_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
build
public BatchProcess build(InputStream is, Map<String,String> runtimeAttributes) throws IOException
Builds a BatchProcess from runtime arguments and a input stream of a configuration file. With the exception of the QueueBuilder, the builders choose how to adjudicate between runtime arguments and the elements in the configuration file. This does not close the InputStream!- Parameters:
is
- inputStreamruntimeAttributes
- incoming runtime attributes- Returns:
- batch process
- Throws:
IOException
-
build
public BatchProcess build(Node docElement, Map<String,String> incomingRuntimeAttributes)
Builds a FileResourceBatchProcessor from runtime arguments and a document node of a configuration file. With the exception of the QueueBuilder, the builders choose how to adjudicate between runtime arguments and the elements in the configuration file.- Parameters:
docElement
- document element of the xml config fileincomingRuntimeAttributes
- runtime arguments- Returns:
- FileResourceBatchProcessor
-
getNumConsumers
public static int getNumConsumers(Map<String,String> attrs)
numConsumers is needed by both the crawler and the consumers. This utility method is to be used to extract the number of consumers from a map of String key value pairs.If the value is "default", not a parseable integer or has a value < 1, then
AbstractConsumersBuilder
'sgetDefaultNumConsumers()
- Parameters:
attrs
- attributes from which to select the NUM_CONSUMERS_KEY- Returns:
- number of consumers
-
-