Search Results for

    Show / Hide Table of Contents

    Class RowTransformBase<TDerived, TInputOutputError>

    An abstract dataflow worker with an Input, Output, and ErrorOutput port, all of the same type, which repeatedly executes the OnInputRow(TInputOutputError) method on each incoming row. The method is passed the row as a parameter, to read and modify as needed. The method does not itself take rows from or send rows to the ports, the passed in row is instead automatically handled as per the method return value.

    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, TInputError, TOutput> instead if the Output port has a different row type. Also see the RowTransformBase example.

    Inheritance
    Object
    WorkerParent
    WorkerBase
    WorkerBase<TDerived>
    RowsTransformBase<TDerived, TInputOutputError, TInputOutputError>
    RowsTransformBase<TDerived, TInputOutputError, TInputOutputError, TInputOutputError>
    RowTransformBase<TDerived, TInputOutputError>
    RowActionTransform<TInputOutputError>
    Implements
    IDisposeOnFinished
    Inherited Members
    RowsTransformBase<TDerived, TInputOutputError, TInputOutputError, TInputOutputError>.ErrorOutput
    RowsTransformBase<TDerived, TInputOutputError, TInputOutputError>.Input
    RowsTransformBase<TDerived, TInputOutputError, TInputOutputError>.OnRowsAndDemandAsync()
    RowsTransformBase<TDerived, TInputOutputError, TInputOutputError>.Output
    RowsTransformBase<TDerived, TInputOutputError, TInputOutputError>.RunAsync()
    WorkerBase<TDerived>.AddCompletedCallback(Func<TDerived, OutcomeStatus, Task<OutcomeStatus>>)
    WorkerBase<TDerived>.AddRanCallback(Func<TDerived, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)
    WorkerBase<TDerived>.AddStartingCallback(Func<TDerived, Task<ProgressStatus>>)
    WorkerBase.AddCompletedCallback(Func<WorkerBase, OutcomeStatus, Task<OutcomeStatus>>)
    WorkerBase.AddRanCallback(Func<WorkerBase, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)
    WorkerBase.AddStartingCallback(Func<WorkerBase, Task<ProgressStatus>>)
    WorkerBase.DefaultIsStartable()
    WorkerBase.ErroredPortErrorsWorkerProtected
    WorkerBase.ErrorOutputs
    WorkerBase.EscalateError
    WorkerBase.Inputs
    WorkerBase.IsStartable
    WorkerBase.Outputs
    WorkerBase.Parent
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(TLastWorker)
    WorkerParent.AddChildCompletedCallback(Action<WorkerBase>)
    WorkerParent.AddStartingChildrenCallback(Func<WorkerParent, Task<ProgressStatus>>)
    WorkerParent.BytesPerRowBuffer
    WorkerParent.Children
    WorkerParent.DisposeOnFinished<TDisposable>(TDisposable)
    WorkerParent.GetDownstreamFactory<TInput>()
    WorkerParent.HasChildren
    WorkerParent.IsCanceled
    WorkerParent.IsCompleted
    WorkerParent.IsCreated
    WorkerParent.IsError
    WorkerParent.IsFailed
    WorkerParent.IsFatal
    WorkerParent.IsRunning
    WorkerParent.IsSucceeded
    WorkerParent.KeepChildrenLevels
    WorkerParent.Locator
    WorkerParent.LogFactory
    WorkerParent.Logger
    WorkerParent.MaxRunningChildren
    WorkerParent.Name
    WorkerParent.RemoveChildren()
    WorkerParent.RescheduleChildren()
    WorkerParent.RunAsync()
    WorkerParent.RunChildrenAsync(Boolean)
    WorkerParent.RunChildrenAsync()
    WorkerParent.Status
    WorkerParent.Item[String]
    WorkerParent.ToString()
    WorkerParent.WorkerSystem
    WorkerParent.DebugCommands
    WorkerParent.AggregateErrorOutputRows
    WorkerParent.AggregateOutputRows
    WorkerParent.AggregateWorkersCompleted
    WorkerParent.InstantCompleted
    WorkerParent.InstantCreated
    WorkerParent.InstantStarted
    WorkerParent.RunningDuration
    Namespace: actionETL
    Assembly: actionETL.dll
    Syntax
    public abstract class RowTransformBase<TDerived, TInputOutputError> : RowsTransformBase<TDerived, TInputOutputError, TInputOutputError, TInputOutputError>, IDisposeOnFinished where TDerived : RowTransformBase<TDerived, TInputOutputError> where TInputOutputError : class
    Type Parameters
    Name Description
    TDerived

    The type of the derived worker. Class definition example:

    public class MyTransform<TInputOutputError>
        : RowsTransformBase<MyTransform<TInputOutputError>,TInputOutputError>
        where TInputOutputError : class
    { 
        // ...
    }
    TInputOutputError

    The type of each Input, Output, and ErrorOutput row.

    Remarks

    To create a transform without any ErrorOutput, consider inheriting from RowsTransformBase<TDerived, TInput, TOutput>.

    Constructors

    RowTransformBase(in DownstreamFactory<TInputOutputError>, 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<TInputOutputError> downstreamFactory, string workerName, bool autoCompleteOutput)
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutputError> 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 "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    Boolean autoCompleteOutput
    • If set to true and the Output is not already completed after the final call to OnInputRow(), it will be automatically completed according to the status returned by the last OnInputRow() call (or by any completed status from a AddStartingCallback(Func<WorkerBase, Task<ProgressStatus>>) callback).
    • If set to false, the Output must be completed by the library user either by a suitable OnInputRow() return value or in a AddCompletedCallback(Func<WorkerBase, OutcomeStatus, Task<OutcomeStatus>>) callback.
    Exceptions
    Type Condition
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    Methods

    OnInputRow(TInputOutputError)

    An abstract synchronous method that gets called when there is an incoming row available for processing. Override it to read and optionally modify each incoming row.

    Declaration
    protected abstract TransformRowTreatment OnInputRow(TInputOutputError inputRow)
    Parameters
    Type Name Description
    TInputOutputError inputRow

    The incoming row. Guaranteed to not be null.

    Returns
    Type Description
    TransformRowTreatment

    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>
    Overrides
    actionETL.RowsTransformBase<TDerived, TInputOutputError, TInputOutputError>.OnRowsAndDemandAsync()

    Implements

    IDisposeOnFinished

    See Also

    TransformRowTreatment
    RowTransformBase<TDerived, TInputError, TOutput>
    In This Article
    Back to top Copyright © 2023 Envobi Ltd