BlockTransformation<TInput, TOutput>

Class BlockTransformation<TInput, TOutput>

A block transformation will wait for all data from the flow to be loaded into its buffer. After all data is in the buffer, the transformation function is executed for the complete data and the result posted into the targets. The block transformations allows you to access all data in the flow in one generic collection. But as this block any processing until all data is buffered, it will also need to store the whole data in memory.

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

Type of ingoing data.

TOutput

Type of outgoing data.

Examples
BlockTransformation<InputType> block = new BlockTransformation<InputType>(
    inputData => {
        inputData.RemoveRange(1, 2);
        inputData.Add(new InputType() { Value = 1 });
        return inputData;
});

Constructors

BlockTransformation()

Declaration
    public BlockTransformation()

BlockTransformation(Func<TInput[], TOutput[]>)

Declaration
    public BlockTransformation(Func<TInput[], TOutput[]> blockTransformationFunc)
Parameters
TypeNameDescription
Func<TInput[], TOutput[]>blockTransformationFunc

Sets the BlockTransformationFunc

Properties

BatchSize

The size of each batch that is passed to the BatchTransformation<TInput, TOutput> Default is 1000.

Declaration
    public override int BatchSize { get; set; }
Property Value
TypeDescription
int
Overrides

BlockTransformationFunc

The transformation Func that is executed on the complete input data. It needs to return an array of output data, which doesn't need have to be the same length as the input array.

Declaration
    public Func<TInput[], TOutput[]> BlockTransformationFunc { get; set; }
Property Value
TypeDescription
Func<TInput[], TOutput[]>

MaxBufferSize

Each component can have one or more buffers to improve throughput and allow faster processing of data. Set this value to restrict the number of rows that can be stored in the buffer. The default value is -1 (unlimited)

Declaration
    public override int MaxBufferSize { get; set; }
Property Value
TypeDescription
int
Overrides

Implements