Sort<TInput>

Class Sort<TInput>

Sorts the incoming data with by the given comparison function. This is a blocking transformation - no output will be produced until all input data has arrived in the transformation.

Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
    public class Sort<TInput> : DataFlowTransformation<TInput, TInput>, IDataFlowTransformation<TInput, TInput>, IDataFlowSource<TInput>, IDataFlowSource, IDataFlowDestination<TInput>, IDataFlowDestination, IDataFlowComponent, ILoggableTask
Type Parameters
NameDescription
TInput

Type of ingoing (and also outgoing) data.

Examples
Comparison<MyDataRow> comp = new Comparison<MyDataRow>(
    (x, y) => y.Value2 - x.Value2
);
Sort<MyDataRow> block = new Sort<MyDataRow>(comp);

Constructors

Sort()

Declaration
    public Sort()

Sort(Comparison<TInput>)

Declaration
    public Sort(Comparison<TInput> sortFunction)
Parameters
TypeNameDescription
Comparison<TInput>sortFunction

Will set the SortFunction

Properties

MaxBufferSize

Declaration
    public int MaxBufferSize { get; }
Property Value
TypeDescription
int

ProgressCount

Declaration
    public int ProgressCount { get; }
Property Value
TypeDescription
int

SortColumns

Declaration
    public ICollection<SortColumn> SortColumns { get; set; }
Property Value
TypeDescription
ICollection<SortColumn>

SortFunction

A System.Comparison used to sort the data. This will always be used first, even if SortColumns are provided.

Declaration
    public Comparison<TInput> SortFunction { get; set; }
Property Value
TypeDescription
Comparison<TInput>

SourceBlock

SourceBlock from the underlying TPL.Dataflow which is used as output buffer for the component.

Declaration
    public override ISourceBlock<TInput> SourceBlock { get; }
Property Value
TypeDescription
ISourceBlock<TInput>
Overrides

TargetBlock

TargetBlock from the underlying TPL.Dataflow which is used as input buffer for the component.

Declaration
    public override ITargetBlock<TInput> TargetBlock { get; }
Property Value
TypeDescription
ITargetBlock<TInput>
Overrides

Methods

CheckParameter()

Declaration
    protected override void CheckParameter()
Overrides

CleanUpOnFaulted(Exception)

Declaration
    protected override void CleanUpOnFaulted(Exception e)
Parameters
TypeNameDescription
Exceptione
Overrides

CleanUpOnSuccess()

Declaration
    protected override void CleanUpOnSuccess()
Overrides

InitComponent()

Declaration
    protected override void InitComponent()
Overrides

LinkErrorTo(IDataFlowDestination<ETLBoxError>)

If an error occurs in the component, by default the component will throw an exception and stop execution. If you use the error linking, any erroneous records will be caught and redirected.

Declaration
    public override IDataFlowSource<ETLBoxError> LinkErrorTo(IDataFlowDestination<ETLBoxError> target)
Parameters
TypeNameDescription
IDataFlowDestination<ETLBoxError>target

The target for erroneous rows.

Returns
TypeDescription
IDataFlowSource<ETLBoxError>

The linked component.

Overrides

PrepareParameterForCheck()

Declaration
    protected override void PrepareParameterForCheck()
Overrides

Reset()

Declaration
    protected override void Reset()
Overrides

Implements