Пример #1
0
        /// <summary>
        /// Connstructeur initialisant les Mapper et les Reducer nécessaires aux traitements métiers des différents modules
        /// </summary>
        /// <param name="name">Nom de cet orchestrateur</param>
        /// <param name="address">Adresse IP</param>
        /// <param name="port">Port d'écoute</param>
        public DnaOrchestra(string name, string address, int port) : base(name, address, port)
        {
            OrchQuantStatMapper  quantStatMapper  = new OrchQuantStatMapper();
            OrchQuantStatReducer quantStatReducer = new OrchQuantStatReducer();

            WorkerFactory.AddWorker(DnaQuantMethod, new TaskExecutor(this, ProcessMapReduce, quantStatMapper, quantStatReducer));
        }
Пример #2
0
 /// <summary>
 /// Constructeur initialisant le nom l'adresse IP et le port d'écoute ainsi que les TaskExecutor associés aux méthodes infrastructures
 /// </summary>
 /// <param name="name">nom du client</param>
 /// <param name="adress">adresse IP</param>
 /// <param name="port">port d'écoute</param>
 protected DefaultClient(string name, string adress, int port) : base(name, adress, port)
 {
     Logger = new Logger(true);
     WorkerFactory.AddWorker(GetCpuMethod, new TaskExecutor(this, RefreshCpuState, null, null));
     WorkerFactory.AddWorker(IdentMethod, new TaskExecutor(this, ProcessIdent, null, null));
     WorkerFactory.AddWorker(TaskStatusMethod, new TaskExecutor(this, RefreshTaskState, null, null));
 }
Пример #3
0
 /// <summary>
 /// Constructeur ajoutant un TastExecutor métier à la WorkerFactory
 /// </summary>
 /// <param name="name">Nom de cet orchestrateur</param>
 /// <param name="address">Adresse IP</param>
 /// <param name="port">Port d'écoute</param>
 public DnaNode(string name, string address, int port) : base(name, address, port, true)
 {
     WorkerFactory.AddWorker(DnaQuantMethod, new TaskExecutor(this, DnaQuantStarter, new QuantStatsMapper(), new QuantStatsReducer()));
     Name    = name;
     Address = address;
     Port    = port;
 }
Пример #4
0
 /// <summary>
 /// Constructeur initialisant les listes de noeuds et clients et générant les TaskExecutor infrastructure
 /// </summary>
 /// <param name="name">Nom Orchestrateur</param>
 /// <param name="address">Adresse IP de l'orchestrateur</param>
 /// <param name="port">Port d'écoute</param>
 protected Orchestrator(string name, string address, int port) : base(name, address, port)
 {
     Logger            = new Logger(true);
     unidentifiedNodes = new List <Tuple <int, Node> >();
     Nodes             = new ConcurrentObservableDictionary <string, Node>();
     Clients           = new ConcurrentDictionary <string, Node>();
     TaskDistrib       = new ConcurrentDictionary <int, Tuple <ConcurrentBag <int>, bool> >();
     WorkerFactory.AddWorker(IdentMethod, new TaskExecutor(this, IdentNode, null, null));
     WorkerFactory.AddWorker(GetCpuMethod, new TaskExecutor(this, ProcessCpuStateOrder, null, null));
     WorkerFactory.AddWorker(TaskStatusMethod, new TaskExecutor(this, RefreshTaskState, null, null));
 }
Пример #5
0
        /// <summary>
        /// Constructeur initialisant l'adresse IP, le port et le nom du noeud ainsi que les worker infrastructure IDENT et GET_CPU
        /// </summary>
        /// <param name="name">Nom du noeud</param>
        /// <param name="adress">Adresse IP du noeud</param>
        /// <param name="port">Port d'écoute</param>
        /// <param name="enabled">Active les logs vers un fichier"</param>
        public DefaultNode(string name, string adress, int port, bool enabled) : base(name, adress, port)
        {
            Logger = new Logger(enabled);

            WorkerTaskStatus = new ConcurrentDictionary <int, Tuple <int, NodeState> >();
            WorkerFactory    = TaskExecFactory.GetInstance();
            try
            {
                WorkerFactory.AddWorker(IdentMethod, new TaskExecutor(this, ProcessIdent, null, null));
                WorkerFactory.AddWorker(GetCpuMethod, new TaskExecutor(this, StartMonitoring, null, null));
            }
            catch (Exception e)
            {
                Logger.Write(e);
            }
        }
Пример #6
0
 /// <summary>
 /// Constructeur initialisant un TaskExecutor avec la méthode de traitement métier pour le Module 1
 /// </summary>
 /// <param name="name"></param>
 /// <param name="adress"></param>
 /// <param name="port"></param>
 public DnaClient(string name, string adress, int port) : base(name, adress, port)
 {
     WorkerFactory.AddWorker(DnaQuantMethod, new TaskExecutor(this, DnaQuantStatDisplay, null, null));
 }