Package org.apache.tika.pipes.core
Class EmitStrategyConfig
java.lang.Object
org.apache.tika.pipes.core.EmitStrategyConfig
- All Implemented Interfaces:
Serializable
Configuration for emit strategy. Can be used in two ways:
- In PipesConfig for default emit strategy (configured via JSON)
- In ParseContext for per-request override (set programmatically)
Example JSON configuration:
{
"pipes": {
"emitStrategy": {
"type": "DYNAMIC",
"thresholdBytes": 100000
}
}
}
Example per-request override:
ParseContext context = new ParseContext(); context.set(EmitStrategyConfig.class, new EmitStrategyConfig(EmitStrategy.PASSBACK_ALL));
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault threshold in bytes for direct emission from PipesServer.static final EmitStrategyDefault emit strategy for PipesServer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the threshold in bytes for DYNAMIC strategy.getType()Get the emit strategy type.voidsetThresholdBytes(Long thresholdBytes) Set the threshold in bytes for DYNAMIC strategy.voidsetType(EmitStrategy type) Set the emit strategy type.
-
Field Details
-
DEFAULT_EMIT_STRATEGY
Default emit strategy for PipesServer. DYNAMIC means the strategy is determined by directEmitThresholdBytes. -
DEFAULT_DIRECT_EMIT_THRESHOLD_BYTES
public static final long DEFAULT_DIRECT_EMIT_THRESHOLD_BYTESDefault threshold in bytes for direct emission from PipesServer. If an extract is larger than this, it will be emitted directly from the forked PipesServer rather than passed back to PipesClient. Only used when emitStrategy is DYNAMIC.- See Also:
-
-
Constructor Details
-
EmitStrategyConfig
public EmitStrategyConfig() -
EmitStrategyConfig
-
EmitStrategyConfig
- Throws:
TikaException
-
-
Method Details
-
getType
Get the emit strategy type.- Returns:
- the emit strategy
-
setType
Set the emit strategy type.- Parameters:
type- the emit strategy- Throws:
TikaConfigException
-
getThresholdBytes
Get the threshold in bytes for DYNAMIC strategy. Only applicable when type is DYNAMIC.- Returns:
- the threshold in bytes, or null to use default
-
setThresholdBytes
Set the threshold in bytes for DYNAMIC strategy. Only applicable when type is DYNAMIC.- Parameters:
thresholdBytes- the threshold in bytes- Throws:
TikaConfigException
-