- Timestamp:
- 12/04/12 15:38:44 (12 years ago)
- Location:
- branches/HiveTaskScheduler/HeuristicLab.Services.Hive
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveTaskScheduler/HeuristicLab.Services.Hive
-
Property
svn:mergeinfo
set to
/trunk/sources/HeuristicLab.Services.Hive merged eligible
-
Property
svn:mergeinfo
set to
-
branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Convert.cs
r8707 r8995 118 118 public static DT.Downtime ToDto(DB.Downtime source) { 119 119 if (source == null) return null; 120 return new DT.Downtime { Id = source.DowntimeId, AllDayEvent = source.AllDayEvent, EndDate = source.EndDate, Recurring = source.Recurring, RecurringId = source.RecurringId, ResourceId = source.ResourceId, StartDate = source.StartDate };120 return new DT.Downtime { Id = source.DowntimeId, AllDayEvent = source.AllDayEvent, EndDate = source.EndDate, Recurring = source.Recurring, RecurringId = source.RecurringId, ResourceId = source.ResourceId, StartDate = source.StartDate, DowntimeType = source.DowntimeType }; 121 121 } 122 122 public static DB.Downtime ToEntity(DT.Downtime source) { … … 127 127 public static void ToEntity(DT.Downtime source, DB.Downtime target) { 128 128 if ((source != null) && (target != null)) { 129 target.DowntimeId = source.Id; target.AllDayEvent = source.AllDayEvent; target.EndDate = source.EndDate; target.Recurring = source.Recurring; target.RecurringId = source.RecurringId; target.ResourceId = source.ResourceId; target.StartDate = source.StartDate; 129 target.DowntimeId = source.Id; target.AllDayEvent = source.AllDayEvent; target.EndDate = source.EndDate; target.Recurring = source.Recurring; target.RecurringId = source.RecurringId; target.ResourceId = source.ResourceId; target.StartDate = source.StartDate; target.DowntimeType = source.DowntimeType; 130 130 } 131 131 } -
branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/DataTransfer/Downtime.cs
r7259 r8995 22 22 using System; 23 23 using System.Runtime.Serialization; 24 using HeuristicLab.Services.Hive.DataAccess; 24 25 25 26 namespace HeuristicLab.Services.Hive.DataTransfer { … … 38 39 [DataMember] 39 40 public Guid ResourceId { get; set; } 41 [DataMember] 42 public DowntimeType DowntimeType { get; set; } 40 43 } 41 44 } -
branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Manager/HeartbeatManager.cs
r8707 r8995 50 50 if (heartbeat.HbInterval != slave.HbInterval) { 51 51 actions.Add(new MessageContainer(MessageContainer.MessageType.NewHBInterval)); 52 } 53 if (ShutdownSlaveComputer(slave.Id)) { 54 actions.Add(new MessageContainer(MessageContainer.MessageType.ShutdownComputer)); 52 55 } 53 56 … … 165 168 private bool SlaveIsAllowedToCalculate(Guid slaveId) { 166 169 // the slave may only calculate if there is no downtime right now. this needs to be checked for every parent resource also 167 return dao.GetParentResources(slaveId).All(r => dao.GetDowntimes(x => x.ResourceId == r.Id && (DateTime.Now >= x.StartDate) && (DateTime.Now <= x.EndDate)).Count() == 0); 170 return dao.GetParentResources(slaveId).All(r => dao.GetDowntimes(x => x.ResourceId == r.Id && x.DowntimeType == DA.DowntimeType.Offline && (DateTime.Now >= x.StartDate) && (DateTime.Now <= x.EndDate)).Count() == 0); 171 } 172 173 private bool ShutdownSlaveComputer(Guid slaveId) { 174 return dao.GetParentResources(slaveId).Any(r => dao.GetDowntimes(x => x.ResourceId == r.Id && x.DowntimeType == DA.DowntimeType.Shutdown && (DateTime.Now >= x.StartDate) && (DateTime.Now <= x.EndDate)).Count() != 0); 168 175 } 169 176 } -
branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/MessageContainer.cs
r7259 r8995 48 48 ShutdownSlave, // slave should shutdown immediately without submitting results 49 49 SayHello, // Slave should say hello, because job is unknown to the server 50 NewHBInterval, 50 NewHBInterval, // change the polling to a new interval 51 ShutdownComputer, // shutdown the computer the slave runs on 51 52 }; 52 53 -
branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Settings.cs
r6983 r8995 1 namespace HeuristicLab.Services.Hive.Properties { 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 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 22 namespace HeuristicLab.Services.Hive.Properties { 2 23 3 24
Note: See TracChangeset
for help on using the changeset viewer.