public void VisitNoOperation(NoOperation node) { }
/// <summary> /// update backups' list /// </summary> /// <param name="msg"></param> public void UpdateBackups(NoOperation msg) { backups = msg.BackupServersInfo; }
protected virtual void ProcessNoOperationMessage(NoOperation message, IDictionary <int, ProblemDataSet> dataSets, IDictionary <int, ActiveComponent> activeComponents) { }
protected virtual Message[] RespondNoOperationMessage(NoOperation message, IDictionary <int, ProblemDataSet> dataSets, IDictionary <int, ActiveComponent> activeComponents) { return(null); }
protected override Message[] RespondStatusMessage(Status message, IDictionary <int, ProblemDataSet> dataSets, IDictionary <int, ActiveComponent> activeComponents, List <BackupServerInfo> backups) { //if sent by TM - send NoOp + return from CaseExtractor.GetMessageForTaskManager //if sent by CN - send NoOp + return from CaseExtractor.GetMessageForCompNode var who = (int)message.Id; if (!activeComponents.ContainsKey(who)) { return new Message[] { new Error() { ErrorMessage = "who are you?", ErrorType = ErrorErrorType.UnknownSender } } } ; activeComponents[who].StatusWatch.Restart(); Message whatToDo = null; Log.DebugFormat("Handling status message of {0}(id={1}). Searching for problems.", activeComponents[who].ComponentType, who); switch (activeComponents[who].ComponentType) { case ComponentType.ComputationalNode: whatToDo = DataSetOps.GetMessageForCompNode(activeComponents, who, dataSets); break; case ComponentType.TaskManager: whatToDo = DataSetOps.GetMessageForTaskManager(activeComponents, who, dataSets); break; case ComponentType.CommunicationServer: var msgs = SynchronizationQueue.ToList(); SynchronizationQueue = new ConcurrentQueue <Message>(); msgs.Add(new NoOperation() { BackupServersInfo = backups.ToArray() }); return(msgs.ToArray()); } var noop = new NoOperation() { BackupServersInfo = backups.ToArray() }; if (whatToDo == null) { Log.DebugFormat("Nothing additional found for {0} (id={1})", activeComponents[who].ComponentType, who); return(new Message[] { noop }); } Log.DebugFormat("Found problem ({0}) for {1} (id={2})", whatToDo.MessageType, activeComponents[who].ComponentType, who); SynchronizationQueue.Enqueue(whatToDo); return(new[] { whatToDo, noop }); }