Class TestProcessor

java.lang.Object
ai.pipestream.module.pipelineprobe.TestProcessor
All Implemented Interfaces:
ai.pipestream.module.runtime.work.ModuleProcessor<ai.pipestream.data.v1.PipeStream>

@ApplicationScoped public class TestProcessor extends Object implements ai.pipestream.module.runtime.work.ModuleProcessor<ai.pipestream.data.v1.PipeStream>
Demand-pull processor for the module-testing-sidecar service. The engine serves PipeStream payloads via ModuleWorkService; this class is the Mutiny-free analogue of the legacy inbound PipeStepProcessorService.processData path.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface ai.pipestream.module.runtime.work.ModuleProcessor

    ai.pipestream.module.runtime.work.ModuleProcessor.PermanentFailure
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Graph-builder key for rich observation taps.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the demand-pull test processor; instances are managed by CDI.
  • Method Summary

    Modifier and Type
    Method
    Description
    ai.pipestream.data.v1.PipeStream
    process(ai.pipestream.data.v1.PipeStream input)
     
    void
    setProcessingDelayMs(long delayMs)
    Overrides the per-document artificial processing delay and logs the new value.
    void
    setRandomFailureRate(double rate)
    Overrides the random failure rate and logs the new value.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ai.pipestream.module.runtime.work.ModuleProcessor

    processToResult
  • Field Details

    • OBSERVE_RICH_PARAM

      public static final String OBSERVE_RICH_PARAM
      Graph-builder key for rich observation taps. Copied into StreamMetadata.context_params by the engine before the module runs.
      See Also:
  • Constructor Details

    • TestProcessor

      public TestProcessor()
      Creates the demand-pull test processor; instances are managed by CDI.
  • Method Details

    • setProcessingDelayMs

      public void setProcessingDelayMs(long delayMs)
      Overrides the per-document artificial processing delay and logs the new value.
      Parameters:
      delayMs - the delay in milliseconds to sleep on each processed document
    • setRandomFailureRate

      public void setRandomFailureRate(double rate)
      Overrides the random failure rate and logs the new value.
      Parameters:
      rate - the probability (between 0.0 and 1.0 inclusive) that a document is failed with a simulated error
      Throws:
      IllegalArgumentException - if rate is outside [0.0, 1.0]
    • process

      public ai.pipestream.data.v1.PipeStream process(ai.pipestream.data.v1.PipeStream input)
      Specified by:
      process in interface ai.pipestream.module.runtime.work.ModuleProcessor<ai.pipestream.data.v1.PipeStream>