The ManipulatorRuntime is the runtime representation of a manipulator instance. The ManipulatorRuntime is created by Manipulator.createManipulatorRuntime() and exists for the life span of the manipulator.
CAS Server creates and passes a PipelineComponentRuntimeContext class to Manipulator.createManipulatorRuntime(). The PipelineComponentRuntimeContext specifies an output channel, error channel, a state directory, and several other runtime properties.
The ErrorChannel.discard() methods discards any invalid records from record processing. Also, in addition to discarding records, the ErrorChannel class processes exceptions that you catch. This processing includes incrementing the appropriate metric for a record and also logging a record in the cas-service.log file. The ErrorChannel logs events at level WARN and higher.
To create a runtime class for a manipulator:
public class SubstringManipulatorRuntime extends ManipulatorRuntime {
}
getContext().getOutputChannel().output(record);A manipulator should not modify any records that have already been output by output(). If you are doing significant processing between calls to output(), you may want to periodically call PipelineComponentRuntimeContext.isStopped() to see if any requests to stop the acquisition have been made while OutputChannel.output() is running.
To see many of the steps above, refer to the sample manipulator extension in <install path>\CAS\version\sample\cas-extensions\src\main\com\endeca\cas\extension\ sample\manipulator\substring\SubstringManipulatorRuntime.java.