Search Results for

    Show / Hide Table of Contents

    Class TwoInputTransformBase<TDerived, TLeftInput, TRightInput, TOutput>

    An abstract dataflow worker with two input ports and one Output port, which can be used to create a dataflow transform. The library user must inherit this class and override the RunAsync() method (which will get called once) to add custom functionality. This method should in turn call methods on the LeftInput and RightInput ports to consume rows from the upstream workers, and call methods on the Output port to send rows to the downstream worker.

    Note that the two inputs by default provide Full buffering of incoming data, which potentially can consume a large amount of memory. Consider whether this is appropriate, or should be overridden, see BufferingMode for further details.

    Note that all dataflow workers must adhere to the Row Ownership rules.

    Consider using TransformBase<TDerived, TInput, TOutput> instead if two input ports are not needed. Also see the TransformBase example.

    Inheritance
    Object
    WorkerParent
    WorkerBase
    WorkerBase<TDerived>
    TwoInputTransformBase<TDerived, TLeftInput, TRightInput, TOutput>
    Implements
    IDisposeOnFinished
    Inherited Members
    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 TwoInputTransformBase<TDerived, TLeftInput, TRightInput, TOutput> : WorkerBase<TDerived>, IDisposeOnFinished where TDerived : TwoInputTransformBase<TDerived, TLeftInput, TRightInput, TOutput> where TLeftInput : class where TRightInput : class where TOutput : class
    Type Parameters
    Name Description
    TDerived

    The type of the derived worker. Class definition example:

    public class MyTransform<TLeftInput,TRightInput,TOutput>
        : TwoInputTransformBase<MyTransform<TLeftInput,TRightInput,TOutput>,TLeftInput,TRightInput,TOutput>
        where TLeftInput : class
        where TRightInput : class
        where TOutput : class
    { 
        // ...
    }
    TLeftInput

    The type of each LeftInput row.

    TRightInput

    The type of each RightInput row.

    TOutput

    The type of each Output row.

    Remarks

    Note: This class only has overloads for asynchronous callbacks, since using synchronous ones would require the callback to block a thread when there is no upstream rows or downstream demand available, which is not appropriate.

    Constructors

    TwoInputTransformBase(in DownstreamFactory<TLeftInput>, String, OutputPortBase<TRightInput>)

    Initializes a new instance of the TwoInputTransformBase<TDerived, TLeftInput, TRightInput, TOutput> abstract dataflow worker. It executes an asynchronous action once, which consumes data from two upstream workers and sends data to one downstream worker.

    Declaration
    protected TwoInputTransformBase(in DownstreamFactory<TLeftInput> downstreamFactory, string workerName, OutputPortBase<TRightInput> rightInputFrom)
    Parameters
    Type Name Description
    DownstreamFactory<TLeftInput> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" LeftInput 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 "__".

    OutputPortBase<TRightInput> rightInputFrom

    The upstream output port to link the RightInput port to.

    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?

    Properties

    LeftInput

    Gets the left input port for consuming rows from the left upstream worker.

    Declaration
    public InputPort<TLeftInput> LeftInput { get; }
    Property Value
    Type Description
    InputPort<TLeftInput>

    The left input port.

    Output

    Gets the output port for sending rows to the downstream worker.

    Declaration
    public OutputPort<TOutput> Output { get; }
    Property Value
    Type Description
    OutputPort<TOutput>

    The output port.

    RightInput

    Gets the right input port for consuming rows from the right upstream worker.

    Declaration
    public InputPort<TRightInput> RightInput { get; }
    Property Value
    Type Description
    InputPort<TRightInput>

    The right input port.

    Implements

    IDisposeOnFinished
    In This Article
    Back to top Copyright © 2023 Envobi Ltd