Class EmitStrategyConfig

java.lang.Object
org.apache.tika.pipes.core.EmitStrategyConfig
All Implemented Interfaces:
Serializable

public class EmitStrategyConfig extends Object implements Serializable
Configuration for emit strategy. Can be used in two ways:
  1. In PipesConfig for default emit strategy (configured via JSON)
  2. 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 Details

    • DEFAULT_EMIT_STRATEGY

      public static final EmitStrategy 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_BYTES
      Default 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

  • Method Details

    • getType

      public EmitStrategy getType()
      Get the emit strategy type.
      Returns:
      the emit strategy
    • setType

      public void setType(EmitStrategy type) throws TikaConfigException
      Set the emit strategy type.
      Parameters:
      type - the emit strategy
      Throws:
      TikaConfigException
    • getThresholdBytes

      public Long 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

      public void setThresholdBytes(Long thresholdBytes) throws TikaConfigException
      Set the threshold in bytes for DYNAMIC strategy. Only applicable when type is DYNAMIC.
      Parameters:
      thresholdBytes - the threshold in bytes
      Throws:
      TikaConfigException