Search Results for

    Show / Hide Table of Contents

    Class MergeSortedTransformFactory

    Factory methods that create a MergeSortedTransform<TInputOutput> dataflow worker, which merges multiple presorted inputs of the same type into a single sorted output. Any duplicates are preserved.

    Note: The row ordering specified in these overloads must match exactly with the incoming row order for each port.

    Note: To concatenate the input rows, i.e. to exhaust each input fully before forwarding any rows from other inputs, in a predefined order, ensure that the sort key range for each input does not overlap with the sort key range for any other input, and that the sort key values matches your desired input port row order. One simple option is to add a constant integer property to each input row type, and use that as the sort key.

    Note that the inputs provide Full buffering of incoming data, and the worker is partially blocking, which potentially can consume a large amount of memory. This is required to avoid potential deadlocks. See BufferingMode for further details.

    Note that input ports can be added after the worker is created (but before it or its siblings have started) by repeatedly calling Create<TInput>(String, OutputPortBase<TInput>). This can be particularly useful when generating workers in a loop.

    The "first" input port (i.e. TypedInputs[0]) is linked to (if available) the upstream output or error output port specified by the factory.

    Get the factory 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>).

    Inheritance
    Object
    MergeSortedTransformFactory
    Namespace: actionETL
    Assembly: actionETL.dll
    Syntax
    public static class MergeSortedTransformFactory

    Methods

    MergeSortedTransform<TInputOutput>(in DownstreamFactory<TInputOutput>, String, OutputPortBase<TInputOutput>[])

    Initializes a new instance of the MergeSortedTransform<TInputOutput> dataflow worker, which merges multiple presorted inputs of the same type into a single sorted output. Any duplicates are preserved.

    The default comparer will be used, which requires that TInputOutput implements IComparable<T> or IComparable.

    The "first" input port is linked to (if available) the upstream output or error output port specified by the factory.

    Declaration
    public static MergeSortedTransform<TInputOutput> MergeSortedTransform<TInputOutput>(this in DownstreamFactory<TInputOutput> downstreamFactory, string workerName, params OutputPortBase<TInputOutput>[] inputsFrom)
        where TInputOutput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutput> 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 "__".

    OutputPortBase<TInputOutput>[] inputsFrom

    The upstream output ports to create input ports for and link from.

    Returns
    Type Description
    MergeSortedTransform<TInputOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutput

    The type of each incoming and Output row.

    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?

    MergeSortedTransform<TInputOutput>(in DownstreamFactory<TInputOutput>, String, Action<IRowComparerCommand<TInputOutput>>, OutputPortBase<TInputOutput>[])

    Initializes a new instance of the MergeSortedTransform<TInputOutput> dataflow worker, which merges multiple presorted inputs of the same type into a single sorted output, by specifying sort columns using a RowComparer<T>. Any duplicates are preserved.

    The "first" input port is linked to (if available) the upstream output or error output port specified by the factory.

    Declaration
    public static MergeSortedTransform<TInputOutput> MergeSortedTransform<TInputOutput>(this in DownstreamFactory<TInputOutput> downstreamFactory, string workerName, Action<IRowComparerCommand<TInputOutput>> rowComparerCommandAction, params OutputPortBase<TInputOutput>[] inputsFrom)
        where TInputOutput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutput> 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 "__".

    Action<IRowComparerCommand<TInputOutput>> rowComparerCommandAction

    Defines the sort order, such as which columns to sort on, ascending vs. descending etc., e.g.:

    cb => cb.Asc("Name").Desc("Price")

    Set to null to use the default comparison (requires that TInputOutput implements IComparable<T> or IComparable). Also see Compare Dataflow Columns.

    Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match.

    OutputPortBase<TInputOutput>[] inputsFrom

    The upstream output ports to create input ports for and link from.

    Returns
    Type Description
    MergeSortedTransform<TInputOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutput

    The type of each incoming and Output row.

    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?

    MergeSortedTransform<TInputOutput>(in DownstreamFactory<TInputOutput>, String, IComparer<TInputOutput>, OutputPortBase<TInputOutput>[])

    Initializes a new instance of the MergeSortedTransform<TInputOutput> dataflow worker, which merges multiple presorted inputs of the same type into a single sorted output, using the specified Comparer<T>. Any duplicates are preserved.

    The "first" input port is linked to (if available) the upstream output or error output port specified by the factory.

    Declaration
    public static MergeSortedTransform<TInputOutput> MergeSortedTransform<TInputOutput>(this in DownstreamFactory<TInputOutput> downstreamFactory, string workerName, IComparer<TInputOutput> rowComparer, params OutputPortBase<TInputOutput>[] inputsFrom)
        where TInputOutput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutput> 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 "__".

    IComparer<TInputOutput> rowComparer

    The IComparer<T> that compares two rows. Set to null to use the default comparison (which requires that TInputOutput implements IComparable<T> or IComparable).

    OutputPortBase<TInputOutput>[] inputsFrom

    The upstream output ports to create input ports for and link from.

    Returns
    Type Description
    MergeSortedTransform<TInputOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutput

    The type of each incoming and Output row.

    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?

    MergeSortedTransform<TInputOutput>(in DownstreamFactory<TInputOutput>, String, Comparison<TInputOutput>, OutputPortBase<TInputOutput>[])

    Initializes a new instance of the MergeSortedTransform<TInputOutput> dataflow worker, which merges multiple presorted inputs of the same type into a single sorted output, using the specified Comparison<T>. Any duplicates are preserved.

    The "first" input port is linked to (if available) the upstream output or error output port specified by the factory.

    Declaration
    public static MergeSortedTransform<TInputOutput> MergeSortedTransform<TInputOutput>(this in DownstreamFactory<TInputOutput> downstreamFactory, string workerName, Comparison<TInputOutput> comparison, params OutputPortBase<TInputOutput>[] inputsFrom)
        where TInputOutput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutput> 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 "__".

    Comparison<TInputOutput> comparison

    The function that compares two rows. Set to null to use the default comparison (which requires that TInputOutput implements IComparable<T> or IComparable).

    OutputPortBase<TInputOutput>[] inputsFrom

    The upstream output ports to create input ports for and link from.

    Returns
    Type Description
    MergeSortedTransform<TInputOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutput

    The type of each incoming and Output row.

    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?

    See Also

    MergeSortedTransform<TInputOutput>
    IComparable<T>
    In This Article
    Back to top Copyright © 2023 Envobi Ltd