/Rhino.Etl.Core/Operations/IOperation.cs

http://github.com/ayende/rhino-etl · C# · 70 lines · 19 code · 11 blank · 40 comment · 0 complexity · 815810e0bace98c5fd60c2e1afe8bc2c MD5 · raw file

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