Class DataFlowComponent
A base class for data flow components
Inheritance
DataFlowComponent
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
public abstract class DataFlowComponent : LoggableTask, IDataFlowComponent, ILoggableTask, IDataFlowLogging
Fields
ReadyForProcessing
Declaration
protected bool ReadyForProcessing
Field Value
WasComponentInitialized
Declaration
protected bool WasComponentInitialized
Field Value
WasLinked
Declaration
protected Dictionary<DataFlowComponent, bool> WasLinked
Field Value
_loggingThresholdRows
Declaration
protected int? _loggingThresholdRows
Field Value
_maxBufferSize
Declaration
protected int? _maxBufferSize
Field Value
Properties
BufferCancellationToken
Declaration
public CancellationToken BufferCancellationToken { get; }
Property Value
Completion
The completion task of the component. A component is completed when all predecessors (if any) are
completed and the current component has completed its buffer.
Declaration
public Task Completion { get; }
Property Value
ErrorSource
The ErrorSource is the source block used for sending errors into the linked error flow.
Declaration
public ErrorSource ErrorSource { get; set; }
Property Value
Exception
If a component encountered an exception or entered a fault state because another component
in the data flow faulted, the thrown exception will be stored in this property.
Declaration
public Exception Exception { get; set; }
Property Value
IsReadyForProcessing
Declaration
public bool IsReadyForProcessing { get; }
Property Value
LogThreshold
To avoid getting log message for every message, by default only log message are produced when 1000 rows
are processed. Set this property to decrease or increase this value.
Declaration
public virtual int? LogThreshold { get; set; }
Property Value
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 virtual int MaxBufferSize { get; set; }
Property Value
OnCompletion
When a component has completed and processed all rows, the OnCompletion action is executed.
Declaration
public Action OnCompletion { get; set; }
Property Value
OnProgress
This delegate is invoked each time the progress counter changes
Declaration
public Action<int> OnProgress { get; set; }
Property Value
Predecessors
All predecessors that are linked to this component.
Declaration
public List<DataFlowComponent> Predecessors { get; protected set; }
Property Value
ProgressCount
The amount of rows the current component has already processed.
Declaration
public int ProgressCount { get; protected set; }
Property Value
Successors
All successors that this component is linked to.
Declaration
public List<DataFlowComponent> Successors { get; protected set; }
Property Value
ThresholdCount
Declaration
protected int ThresholdCount { get; set; }
Property Value
Methods
CancelBufferAndThrowOperationCanceledException()
Declaration
protected void CancelBufferAndThrowOperationCanceledException()
CancelComponent()
Will cancel completion task for this component only.
If you want to cancel the whole network, use Network.Cancel(..) instead
Declaration
public void CancelComponent()
CheckParameter()
Declaration
protected abstract void CheckParameter()
CleanUpOnFaulted(Exception)
Declaration
protected virtual void CleanUpOnFaulted(Exception e = null)
Parameters
CleanUpOnSuccess()
Declaration
protected virtual void CleanUpOnSuccess()
CompleteOrFaultBufferOnPredecessorCompletion(Task)
Declaration
protected void CompleteOrFaultBufferOnPredecessorCompletion(Task WhenAllPredecessorCompletionTasks)
Parameters
Type | Name | Description |
---|
Task | WhenAllPredecessorCompletionTasks | |
InitBufferObjects(CancellationToken?)
Inits the underlying TPL.Dataflow buffer objects. After this, the component is ready for linking
its source or target blocks. The initialization is done automatically when
a network is executed.
Declaration
public void InitBufferObjects(CancellationToken? cancellationToken = null)
Parameters
Type | Name | Description |
---|
CancellationToken? | cancellationToken | A cancellation token that is linked with the cancellation token
of each buffer |
InitComponent()
Declaration
protected abstract void InitComponent()
InitParameter()
Declaration
protected virtual void InitParameter()
InternalLinkErrorTo(IDataFlowDestination<ETLBoxError>)
Declaration
protected IDataFlowSource<ETLBoxError> InternalLinkErrorTo(IDataFlowDestination<ETLBoxError> target)
Parameters
Returns
InternalLinkTo<T>(IDataFlowDestination, object, object)
Declaration
protected IDataFlowSource<T> InternalLinkTo<T>(IDataFlowDestination target, object predicate = null, object voidPredicate = null)
Parameters
Returns
Type Parameters
LinkBuffersRecursively()
Declaration
protected void LinkBuffersRecursively()
LogProgressBatch_AfterThrowOrRedirectError(int)
Declaration
protected void LogProgressBatch_AfterThrowOrRedirectError(int rowsProcessed)
Parameters
Type | Name | Description |
---|
int | rowsProcessed | |
LogProgress_AfterThrowOrRedirectError()
Declaration
protected void LogProgress_AfterThrowOrRedirectError()
LoggingFinishOnce()
Declaration
protected void LoggingFinishOnce()
LoggingStartOnce()
Declaration
protected void LoggingStartOnce()
PrepareParameter()
Declaration
protected virtual void PrepareParameter()
RunErrorSourceInit()
Declaration
protected void RunErrorSourceInit()
SetCompletionTask()
Declaration
protected void SetCompletionTask()
SetParent(DataFlowComponent)
Will set another component as a parent component - only needed for constructing subflow
inside data flow components.
Declaration
public void SetParent(DataFlowComponent parent)
Parameters
ThrowErrorAndFaultNetwork(Exception, string)
Declaration
protected void ThrowErrorAndFaultNetwork(Exception e, string erroneousData)
Parameters
ThrowOrRedirectError(Exception, string, string)
Declaration
protected void ThrowOrRedirectError(Exception e, string erroneousData, string errorContext = null)
Parameters
Implements