private void Start(string[] argv) { Console.WriteLine("Partition module started..."); Console.WriteLine("Press CTRL+C to exit!"); logger.Info("Partition module started."); // event subscriptitons Console.CancelKeyPress += HandleInterupt; this.matcherRegistry.MatchersReady += StartMatchers; this.matcherRegistry.MatchersDone += (s, e) => { Task.Run(new Action(RestartMatchers)); }; CompositionService.Default.Initialize(); logger.Info("CompositionService initalized successfully."); ParseCommandLineArguments(argv); logger.Info("Selected {0} for model.", this.ModelFileName); ModelLoader loader = new ModelLoader(this.ModelFileName); var model = loader.LoadModel(); Partitioner partitioner = new Partitioner(model); var partitions = partitioner.Partition(); this.partitionRegistry = new PartitionRegistry(partitions); var service = new PartitionBrokerService(); service.Start(); if (!this.IsDebug) { RemoteMatcherInstantiator rmi = new RemoteMatcherInstantiator(service.BaseAddress); rmi.Start(partitions.Count()); this.matchersStarted = true; Console.WriteLine("Started {0} matcher(s)...", partitions.Count()); } Console.WriteLine("Partitioner started, waitng for matcher modules to come in."); this.exit.WaitOne(); service.Close(); }
public PartitionSelector(MatcherRegistry matcherRegistry, PartitionRegistry partitionRegistry) { this.matcherRegistry = matcherRegistry; this.partitionRegistry = partitionRegistry; }