public StdHandler(OutputSource aSource, System.Diagnostics.Process aProcess, ExecOutputDelegate aOutput) { itsProcess = aProcess; Source = aSource; Output = aOutput; if (Source == OutputSource.stderr) aProcess.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(OutputDataReceived); else aProcess.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(OutputDataReceived); }
public async Task ExecuteAsync() => await OutputSource.ExecuteAsync();
public IDataFlowLinkSource <TInput> LinkTo(IDataFlowLinkTarget <TInput> target) => OutputSource.LinkTo(target);
private void SetDestinationTableProperties() { DestinationTable.ConnectionManager = ConnectionManager; DestinationTable.TableName = TableName; DestinationTable.BatchSize = BatchSize; DestinationTable.MaxBufferSize = this.MaxBufferSize; DestinationTable.BeforeBatchWrite = batch => { if (MergeMode == MergeMode.Delta) { DeltaTable.AddRange(batch.Where(row => GetChangeAction(row) != ChangeAction.Delete)); } else if (MergeMode == MergeMode.UpdatesOnly) { DeltaTable.AddRange(batch.Where(row => GetChangeAction(row) == ChangeAction.Exists || GetChangeAction(row) == ChangeAction.Update)); } else { DeltaTable.AddRange(batch); } if (!UseTruncateMethod) { if (MergeMode == MergeMode.UpdatesOnly) { SqlUpdateIds(batch.Where(row => GetChangeAction(row) == ChangeAction.Update)); return(batch.Where(row => false).ToArray()); } else { SqlUpdateIds(batch.Where(row => GetChangeAction(row) == ChangeAction.Update)); SqlDeleteIds(batch.Where(row => GetChangeAction(row) == ChangeAction.Delete)); return(batch.Where(row => GetChangeAction(row) == ChangeAction.Insert).ToArray()); } } else { if (MergeMode == MergeMode.Delta) { throw new ETLBoxNotSupportedException("If you provide a delta load, you must define at least one compare column." + "Using the truncate method is not allowed. "); } TruncateDestinationOnce(); if (MergeMode == MergeMode.UpdatesOnly) { return(batch.Where(row => GetChangeAction(row) != ChangeAction.Delete && GetChangeAction(row) != ChangeAction.Insert).ToArray()); } else { return(batch.Where(row => GetChangeAction(row) == ChangeAction.Insert || GetChangeAction(row) == ChangeAction.Update || GetChangeAction(row) == ChangeAction.Exists) .ToArray()); } } }; DestinationTable.OnCompletion = () => { IdentifyAndDeleteMissingEntries(); if (UseTruncateMethod && (MergeMode == MergeMode.UpdatesOnly || MergeMode == MergeMode.InsertsAndUpdatesOnly)) { ReinsertTruncatedRecords(); } if (Successors.Count > 0) { OutputSource.ExecuteAsync(); OutputSource.Completion.Wait(); //Careful: A TPL buffer never completes if it has no consumer linked to it!!! OutputSource.BufferCompletion.Wait(); } }; }
private void SetOutputFlow() { OutputSource.MaxBufferSize = this.MaxBufferSize; SetOutputReadFunc(); OutputSource.InitBufferObjects(); }
public SpectrumAnalyzer(OutputSource output) { InitializeComponent(); NotSpectrumAnalyzer.Source = output; }
internal override void FaultBufferOnPredecessorCompletion(Exception e) { Lookup.FaultBufferOnPredecessorCompletion(e); OutputSource.FaultBufferOnPredecessorCompletion(e); }
public void Execute() => OutputSource.PostAll();
public Timeclock(OutputSource output) { InitializeComponent(); NotTimeclock.SourceCollection.Add(output); }
public void LinkTo(IDataFlowLinkTarget <TInput> target, Predicate <TInput> predicate) => OutputSource.LinkTo(target);
public void PostAll() => OutputSource.PostAll();
/// <summary> /// Generates the OUTPUT clause. /// </summary> /// <param name="prev">A predecessor table.</param> /// <param name="outputSource">Is a data source (Inserted or Deleted) of the OUTPUT clause.</param> /// <returns></returns> public static OutputChainer Output(this IOutput prev, OutputSource outputSource) { return(new OutputChainer((Chainer)prev, null, outputSource)); }
public void Execute() => OutputSource.Execute();
public override void Execute() => OutputSource.Execute();
public void ExecuteAsync() => OutputSource.ExecuteAsync();
public Timeline(OutputSource output) { InitializeComponent(); NotTimeline.Source = output; }