/Rhino.Etl.Core/Operations/IOperation.cs
C# | 70 lines | 19 code | 11 blank | 40 comment | 0 complexity | 815810e0bace98c5fd60c2e1afe8bc2c MD5 | raw file
1namespace Rhino.Etl.Core.Operations 2{ 3 using System; 4 using System.Collections; 5 using System.Collections.Generic; 6 7 /// <summary> 8 /// A single operation in an etl process 9 /// </summary> 10 public interface IOperation : IDisposable 11 { 12 /// <summary> 13 /// Gets the name. 14 /// </summary> 15 /// <value>The name.</value> 16 string Name { get; } 17 18 /// <summary> 19 /// Sets the transaction. 20 /// </summary> 21 /// <value>True or false.</value> 22 bool UseTransaction { get; set; } 23 24 /// <summary> 25 /// Gets the statistics for this operation 26 /// </summary> 27 /// <value>The statistics.</value> 28 OperationStatistics Statistics { get; } 29 30 /// <summary> 31 /// Occurs when a row is processed. 32 /// </summary> 33 event Action<IOperation, Row> OnRowProcessed; 34 35 /// <summary> 36 /// Occurs when all the rows has finished processing. 37 /// </summary> 38 event Action<IOperation> OnFinishedProcessing; 39 40 /// <summary> 41 /// Initializes the current instance 42 /// </summary> 43 /// <param name="pipelineExecuter">The current pipeline executer.</param> 44 void PrepareForExecution(IPipelineExecuter pipelineExecuter); 45 46 /// <summary> 47 /// Executes this operation 48 /// </summary> 49 /// <param name="rows">The rows.</param> 50 IEnumerable<Row> Execute(IEnumerable<Row> rows); 51 52 /// <summary> 53 /// Raises the row processed event 54 /// </summary> 55 /// <param name="dictionary">The dictionary.</param> 56 void RaiseRowProcessed(Row dictionary); 57 58 /// <summary> 59 /// Raises the finished processing event 60 /// </summary> 61 void RaiseFinishedProcessing(); 62 63 /// <summary> 64 /// Gets all errors that occured when running this operation 65 /// </summary> 66 /// <returns></returns> 67 IEnumerable<Exception> GetAllErrors(); 68 } 69 70}