PageRenderTime 423ms CodeModel.GetById 150ms app.highlight 3ms RepoModel.GetById 178ms app.codeStats 1ms

/Rhino.Etl.Tests/Branches/FibonacciBranchingProcess.cs

http://github.com/ayende/rhino-etl
C# | 34 lines | 27 code | 7 blank | 0 comment | 1 complexity | 4a789d52b3cac8c9ddef91845b8a9b56 MD5 | raw file
 1using Rhino.Etl.Core;
 2using Rhino.Etl.Core.Operations;
 3using Rhino.Etl.Core.Pipelines;
 4using Rhino.Etl.Tests.Fibonacci;
 5using Rhino.Etl.Tests.Fibonacci.Bulk;
 6
 7namespace Rhino.Etl.Tests.Branches
 8{
 9    public class FibonacciBranchingProcess : EtlProcess
10    {
11        private readonly int numberOfFibonacciIterations;
12        private readonly int numberOfChildOperations;
13
14        public FibonacciBranchingProcess(int numberOfFibonacciIterations, int numberOfChildOperations)
15        {
16            this.numberOfFibonacciIterations = numberOfFibonacciIterations;
17            this.numberOfChildOperations = numberOfChildOperations;
18        }
19
20        protected override void Initialize()
21        {
22            PipelineExecuter = new SingleThreadedPipelineExecuter();
23
24            Register(new FibonacciOperation(numberOfFibonacciIterations));
25
26            var split = new BranchingOperation();
27
28            for (int i = 0; i < numberOfChildOperations; i++)
29                split.Add(new FibonacciBulkInsert());
30
31            Register(split);
32        }
33    }
34}