Search Results for

    Show / Hide Table of Contents

    Class FileHelperStreamTarget<TInput>

    A dataflow worker with one Input port, for writing incoming data rows as delimited (e.g. CSV) or fixed format records to a Stream.

    Note: Use the factory methods in FileHelperStreamTargetFactory to create instances of this class.

    Please see CSV Delimited and Fixed Format for how to specify the data format. Internally, this worker uses the http://www.filehelpers.net/ library to read the data, specifically the FileHelperAsyncEngine class.

    Inheritance
    Object
    WorkerParent
    WorkerBase
    WorkerBase<FileHelperStreamTarget<TInput>>
    FileHelperStreamTarget<TInput>
    Implements
    IDisposeOnFinished
    Inherited Members
    WorkerBase<FileHelperStreamTarget<TInput>>.AddCompletedCallback(Func<FileHelperStreamTarget<TInput>, OutcomeStatus, Task<OutcomeStatus>>)
    WorkerBase<FileHelperStreamTarget<TInput>>.AddRanCallback(Func<FileHelperStreamTarget<TInput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)
    WorkerBase<FileHelperStreamTarget<TInput>>.AddStartingCallback(Func<FileHelperStreamTarget<TInput>, Task<ProgressStatus>>)
    WorkerBase.AddCompletedCallback(Func<WorkerBase, OutcomeStatus, Task<OutcomeStatus>>)
    WorkerBase.AddRanCallback(Func<WorkerBase, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)
    WorkerBase.AddStartingCallback(Func<WorkerBase, Task<ProgressStatus>>)
    WorkerBase.DefaultIsStartable()
    WorkerBase.ErroredPortErrorsWorkerProtected
    WorkerBase.ErrorOutputs
    WorkerBase.EscalateError
    WorkerBase.Inputs
    WorkerBase.IsStartable
    WorkerBase.Outputs
    WorkerBase.Parent
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(TLastWorker)
    WorkerParent.AddChildCompletedCallback(Action<WorkerBase>)
    WorkerParent.AddStartingChildrenCallback(Func<WorkerParent, Task<ProgressStatus>>)
    WorkerParent.BytesPerRowBuffer
    WorkerParent.Children
    WorkerParent.DisposeOnFinished<TDisposable>(TDisposable)
    WorkerParent.GetDownstreamFactory<TInput>()
    WorkerParent.HasChildren
    WorkerParent.IsCanceled
    WorkerParent.IsCompleted
    WorkerParent.IsCreated
    WorkerParent.IsError
    WorkerParent.IsFailed
    WorkerParent.IsFatal
    WorkerParent.IsRunning
    WorkerParent.IsSucceeded
    WorkerParent.KeepChildrenLevels
    WorkerParent.Locator
    WorkerParent.LogFactory
    WorkerParent.Logger
    WorkerParent.MaxRunningChildren
    WorkerParent.Name
    WorkerParent.RemoveChildren()
    WorkerParent.RescheduleChildren()
    WorkerParent.RunChildrenAsync(Boolean)
    WorkerParent.RunChildrenAsync()
    WorkerParent.Status
    WorkerParent.Item[String]
    WorkerParent.ToString()
    WorkerParent.WorkerSystem
    WorkerParent.DebugCommands
    WorkerParent.AggregateErrorOutputRows
    WorkerParent.AggregateOutputRows
    WorkerParent.AggregateWorkersCompleted
    WorkerParent.InstantCompleted
    WorkerParent.InstantCreated
    WorkerParent.InstantStarted
    WorkerParent.RunningDuration
    Namespace: actionETL.FileHelper
    Assembly: actionETL.dll
    Syntax
    [CLSCompliant(false)]
    public class FileHelperStreamTarget<TInput> : WorkerBase<FileHelperStreamTarget<TInput>>, IDisposeOnFinished where TInput : class
    Type Parameters
    Name Description
    TInput

    The type of each Input row, which also defines the file format, columns, separators, column order etc. of the written data.

    Properties

    Engine

    Gets the underlying FileHelpers FileHelperAsyncEngine instance. Use this for customizing the data transfer, such as setting the text encoding and preprocess the data records. See CSV Delimited and Fixed Format for details.

    Note: Retrieving and inspecting this property is thread-safe, but modifying the Engine state is not thread-safe, and should only be done from a single thread, before the worker has started.

    Declaration
    public FileHelperAsyncEngine<TInput> Engine { get; }
    Property Value
    Type Description
    FileHelpers.FileHelperAsyncEngine<TInput>

    The FileHelpers engine instance.

    Remarks

    Note that in rare cases, and only when using non-C# .NET languages, direct use of the Engine property can fail with a compile time error since the underlying FileHelpers library class (FileHelperAsyncEngine) is not CLS compliant (warning CS3003).

    FooterText

    The footer text to write at the end of the output, if any. Defaults to the names of the members written to the output. Set it to null to not output any header text. Any non-null string will be output verbatim. Cannot be set after the worker has started running.

    Note: This property is thread-safe.

    Declaration
    public string FooterText { get; set; }
    Property Value
    Type Description
    String
    Exceptions
    Type Condition
    InvalidOperationException

    Cannot set the value after the worker has started running.

    HeaderText

    The header text to write at the start of the output, if any. Defaults to the names of the members written to the output. Set it to null to not output any header text. Any non-null string will be output verbatim. Cannot be set after the worker has started running.

    Note: This property is thread-safe.

    Declaration
    public string HeaderText { get; set; }
    Property Value
    Type Description
    String
    Exceptions
    Type Condition
    InvalidOperationException

    Cannot set the value after the worker has started running.

    Input

    Gets the input port for receiving rows from an upstream worker.

    Declaration
    public InputPort<TInput> Input { get; }
    Property Value
    Type Description
    InputPort<TInput>

    TextWriter

    gets or sets the text writer to write to. Cannot be set after the worker has started running.

    Note: This property is thread-safe.

    Declaration
    public TextWriter TextWriter { get; set; }
    Property Value
    Type Description
    TextWriter
    Exceptions
    Type Condition
    InvalidOperationException

    Cannot set the value after the worker has started running.

    Methods

    RunAsync()

    This method can be overridden to add custom functionality to the derived worker that runs before and after the row processing. In this case, the base class base.RunAsync() must be called for the worker to function correctly.

    Typically, this worker is used without overriding this method.

    Declaration
    protected override Task<OutcomeStatus> RunAsync()
    Returns
    Type Description
    Task<OutcomeStatus>

    A Task describing the success or failure of the worker. An asynchronous async implementation would e.g. return OutcomeStatus.Succeeded on success, while a synchronous implementation would return OutcomeStatus.SucceededTask.

    Overrides
    WorkerParent.RunAsync()

    Implements

    IDisposeOnFinished

    See Also

    FileHelperFileTargetFactory
    FileHelperStreamTargetFactory
    In This Article
    Back to top Copyright © 2023 Envobi Ltd