Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3082_Scaling/HeuristicLab.Services.Hive/3.3/MessageContainer.cs @ 18132

Last change on this file since 18132 was 17574, checked in by jkarder, 4 years ago

#3062: overhauled statistics generation and cleanup

  • switched to a single thread for database cleanup and statistics generation (executed sequentially)
  • switched to preemptive deletion of items that are in status DeletionPending (for jobs: statelogs, taskdata, tasks)
  • added code that aborts tasks whose jobs have already been marked for deletion
  • added method UseTransactionAndSubmit in addition to UseTransaction in PersistenceManager
  • updated DAO methods and introduced more bare metal sql
  • introduced DAO methods for batch deletion
  • fixed usage of enum values in DAO sql queries
  • deleted unnecessary triggers tr_JobDeleteCascade and tr_TaskDeleteCascade in Prepare Hive Database.sql
  • changed scheduling for less interference with janitor and other heartbeats
    • increased scheduling patience from 20 to 70 seconds (to wait longer to get the mutex for scheduling)
    • changed signature of ITaskScheduler.Schedule
    • added base class for TaskSchedulers and moved assignment of tasks to slaves into it
    • changed RoundRobinTaskScheduler to use bare metal sql
  • made MessageContainer a storable type (leftover)
  • updated HiveJanitorServiceInstaller.nsi
File size: 3.2 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Runtime.Serialization;
24using HEAL.Attic;
25using HeuristicLab.Common;
26
27namespace HeuristicLab.Services.Hive {
28  /// <summary>
29  /// The MessageContainer is a container class for Messages. Its two parts are:
30  /// the actual message itself and the TaskId, refered by the message
31  /// </summary>
32  [StorableType("67DEE81F-81FA-4B47-B043-93DBC2028DB5")]
33  [Serializable]
34  [DataContract]
35  public class MessageContainer : IDeepCloneable {
36    [StorableType("A907BDB0-99E3-4EE2-BA31-72FFD29F7B19")]
37    public enum MessageType {
38      // *** commands from hive server ***
39      CalculateTask, // slave should calculate a task. the task is already assigned to the slave
40      StopTask,   // slave should stop the task and submit results
41      StopAll,   // stop all and submit results
42      AbortTask,  // slave should shut the task down immediately without submitting results
43      AbortAll,  // slave should abort all task immediately
44      PauseTask,  // pause the task and submit the results   
45      PauseAll,  // pause all task and submit results
46      Restart,   // restart operation after Sleep
47      Sleep,     // disconnect from server, but don't shutdown
48      ShutdownSlave,  // slave should shutdown immediately without submitting results
49      SayHello,  // Slave should say hello, because job is unknown to the server
50      NewHBInterval, // change the polling to a new interval
51      ShutdownComputer, // shutdown the computer the slave runs on
52    };
53
54    [Storable]
55    [DataMember]
56    public MessageType Message { get; set; }
57
58    [Storable]
59    [DataMember]
60    public Guid TaskId { get; set; }
61
62    [StorableConstructor]
63    protected MessageContainer(StorableConstructorFlag _) { }
64    protected MessageContainer() { }
65    public MessageContainer(MessageType message) {
66      Message = message;
67      TaskId = Guid.Empty;
68    }
69    public MessageContainer(MessageType message, Guid jobId) {
70      Message = message;
71      TaskId = jobId;
72    }
73    protected MessageContainer(MessageContainer original, Cloner cloner) {
74      cloner.RegisterClonedObject(original, this);
75      this.Message = original.Message;
76      this.TaskId = original.TaskId;
77    }
78    public virtual IDeepCloneable Clone(Cloner cloner) {
79      return new MessageContainer(this, cloner);
80    }
81    public object Clone() {
82      return Clone(new Cloner());
83    }
84  }
85}
Note: See TracBrowser for help on using the repository browser.