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>).
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
While less useful, set to
The name cannot otherwise contain |
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 |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
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
While less useful, set to
The name cannot otherwise contain |
Action<IRowComparerCommand<TInputOutput>> | rowComparerCommandAction | Defines the sort order, such as which columns to sort on, ascending vs. descending etc., e.g.:
Set to 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 |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
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
While less useful, set to
The name cannot otherwise contain |
IComparer<TInputOutput> | rowComparer | The IComparer<T> that compares two rows.
Set to |
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 |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
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
While less useful, set to
The name cannot otherwise contain |
Comparison<TInputOutput> | comparison | The function that compares two rows.
Set to |
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 |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|