Class CrossJoin<TInput1, TInput2, TOutput>

The CrossJoin allows you to combine every record from one input with every record from the other input. The input for the first table will be loaded into memory before join starts. Then every incoming row will be joined with every row of the InMemory-Table using the CrossJoinFunc function. The InMemory target should always be the target of the smaller amount of data to reduce memory consumption and processing time.

Inheritance
System.Object
CrossJoin<TInput1, TInput2, TOutput>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.DataFlow.Transformations
Assembly: ETLBox.dll
Syntax
    public class CrossJoin<TInput1, TInput2, TOutput> : DataFlowSource<TOutput>, ILoggableTask, IDataFlowLogging, IDataFlowTransformation<TOutput>, IDataFlowSource<TOutput>, IDataFlowSource, IDataFlowDestination, IDataFlowComponent
Type Parameters
NameDescription
TInput1

Type of data for in memory input block.

TInput2

Type of data for processing input block.

TOutput

Type of output data.

Examples
CrossJoin<InputType1, InputType2, OutputType> crossJoin = new CrossJoin<InputType1, InputType2, OutputType>();
crossJoin.CrossJoinFunc = (inmemoryRow, passingRow) => {
    return new OutputType() {
        Result = leftRow.Value1 + rightRow.Value2
    };
});
source1.LinkTo(join.InMemoryTarget);
source2.LinkTo(join.PassingTarget);
join.LinkTo(dest);

Constructors

CrossJoin()

Declaration
    public CrossJoin()

CrossJoin(Func<TInput1, TInput2, TOutput>)

Declaration
    public CrossJoin(Func<TInput1, TInput2, TOutput> crossJoinFunc)
Parameters
TypeNameDescription
System.Func<TInput1, TInput2, TOutput>crossJoinFunc

Sets the CrossJoinFunc

Properties

Buffer

Declaration
    protected BufferBlock<TOutput> Buffer { get; set; }
Property Value
TypeDescription
System.Threading.Tasks.Dataflow.BufferBlock<TOutput>

CrossJoinFunc

The cross join function that describes how records from the both target can be joined.

Declaration
    public Func<TInput1, TInput2, TOutput> CrossJoinFunc { get; set; }
Property Value
TypeDescription
System.Func<TInput1, TInput2, TOutput>

InMemoryTarget

The in-memory target of the CrossJoin. This will block processing until all data is received that is designated for this target. Always have the smaller amount of data flown into this target.

Declaration
    public CrossJoin<TInput1, TInput2, TOutput>.InMemoryDestination<TInput1> InMemoryTarget { get; set; }
Property Value
TypeDescription
CrossJoin.InMemoryDestination<TInput1>

PassingTarget

Every row that the PassingTarget receives is joined with all data from the ETLBox.DataFlow.Transformations.CrossJoin`3.InMemoryData.

Declaration
    public JoinTarget<TInput2> PassingTarget { get; set; }
Property Value
TypeDescription
JoinTarget<TInput2>

SourceBlock

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

Declaration
    public override ISourceBlock<TOutput> SourceBlock { get; }
Property Value
TypeDescription
System.Threading.Tasks.Dataflow.ISourceBlock<TOutput>
Overrides
ETLBox.DataFlow.DataFlowSource<TOutput>.SourceBlock

TaskName

A name to identify the task or component. Every component or task comes with a default name that can be overwritten.

Declaration
    public override string TaskName { get; set; }
Property Value
TypeDescription
System.String
Overrides

Methods

CheckParameter()

Declaration
    protected override void CheckParameter()
Overrides

CleanUpOnFaulted(Exception)

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

CleanUpOnSuccess()

Declaration
    protected override void CleanUpOnSuccess()
Overrides

InitComponent()

Declaration
    protected override void InitComponent()
Overrides

Implements