Class RowTransformBase<TDerived, TInputError, TOutput>
An abstract dataflow worker with and Input, Output, and ErrorOutput port,
where Input and ErrorOutput have the same type, which repeatedly executes the
OnInputRow(TInputError) method on each incoming row.
The method returns a (usually different) output row to the downstream worker, or no row at all.
When outputting a row, the function is responsible for either allocating
a new output row, or if appropriate cast the input row to the output type,
before passing returning it.
The library user must inherit this class and override OnInputRow to provide
custom functionality.
If the method throws an exception, the input row will be rejected to the ErrorOutput port.
The derived class can additionally override RunAsync()
to add logic that runs before and after all processing of rows, in which case the base class
base.RunAsync() must be called. The derived class (or its user) can also use
worker callbacks to add logic.
The input port uses the Default policy. Consider whether this is appropriate, or should be overridden, see BufferingMode for further details.
Use RowTransformBase<TDerived, TInputOutputError> instead if the all ports have the same row type. Also see the RowTransformBase example.
Inheritance
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public abstract class RowTransformBase<TDerived, TInputError, TOutput> : RowsTransformBase<TDerived, TInputError, TOutput>, IDisposeOnFinished where TDerived : RowTransformBase<TDerived, TInputError, TOutput> where TInputError : class where TOutput : class
Type Parameters
| Name | Description |
|---|---|
| TDerived | The type of the derived worker. Class definition example:
|
| TInputError | The type of each |
| TOutput | The type of each |
Constructors
RowTransformBase(in DownstreamFactory<TInputError>, String, Boolean)
Initializes a new instance of the RowTransformBase<TDerived, TInputOutputError>
abstract dataflow worker, which repeatedly executes the OnInputRow method when there are
input rows and output demand available on the ports.
Declaration
protected RowTransformBase(in DownstreamFactory<TInputError> downstreamFactory, string workerName, bool autoCompleteOutput)
Parameters
| Type | Name | Description |
|---|---|---|
| DownstreamFactory<TInputError> | downstreamFactory | The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to. Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>). |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Boolean | autoCompleteOutput | After the final call to
|
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
Properties
ErrorOutput
Gets the error output port for sending error rows to logging and an optional downstream worker.
Declaration
public ErrorOutputPort<TInputError> ErrorOutput { get; }
Property Value
| Type | Description |
|---|---|
| ErrorOutputPort<TInputError> |
Methods
OnInputRow(TInputError)
An abstract synchronous method that will get called for each incoming row. Override it and process each incoming row.
Declaration
protected abstract (TransformRowTreatment, TOutput) OnInputRow(TInputError inputRow)
Parameters
| Type | Name | Description |
|---|---|---|
| TInputError | inputRow | The incoming row. Guaranteed to not be |
Returns
| Type | Description |
|---|---|
| (T1, T2)<TransformRowTreatment, TOutput> | If and how the input row should be passed to downstream workers. |
OnRowsAndDemandAsync()
For internal use.
Declaration
protected sealed override Task<ProgressStatus> OnRowsAndDemandAsync()
Returns
| Type | Description |
|---|---|
| Task<ProgressStatus> |