- Timestamp:
- 12/04/12 15:38:44 (12 years ago)
- Location:
- branches/HiveTaskScheduler
- Files:
-
- 12 edited
- 1 copied
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.DataAccess
-
Property
svn:mergeinfo
set to
/trunk/sources/HeuristicLab.Services.Hive.DataAccess merged eligible
-
Property
svn:mergeinfo
set to
-
branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
r8600 r8995 99 99 <None Include="Plugin.cs.frame" /> 100 100 <Compile Include="Enums\Command.cs" /> 101 <Compile Include="Enums\DowntimeType.cs" /> 101 102 <Compile Include="Enums\CpuArchitecture.cs" /> 102 103 <Compile Include="Plugin.cs" /> … … 156 157 </PropertyGroup> 157 158 <PropertyGroup> 158 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)159 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 159 160 set ProjectDir=$(ProjectDir) 160 161 set SolutionDir=$(SolutionDir) … … 162 163 163 164 call PreBuildEvent.cmd</PreBuildEvent> 164 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">165 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 165 166 export ProjectDir=$(ProjectDir) 166 167 export SolutionDir=$(SolutionDir) -
branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.cs
r6983 r8995 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 1 22 using System; 2 23 using System.Data.Linq.Mapping; -
branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
r8707 r8995 95 95 <Column Name="Recurring" Type="System.Boolean" DbType="Bit" CanBeNull="false" /> 96 96 <Column Name="RecurringId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" /> 97 <Column Name="DowntimeType" Storage="_Type" Type="global::HeuristicLab.Services.Hive.DataAccess.DowntimeType" DbType="VarChar(MAX)" CanBeNull="false" /> 97 98 <Association Name="Resource_Downtime" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" /> 98 99 </Type> -
branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
r8707 r8995 2164 2164 private System.Guid _RecurringId; 2165 2165 2166 private global::HeuristicLab.Services.Hive.DataAccess.DowntimeType _Type; 2167 2166 2168 private EntityRef<Resource> _Resource; 2167 2169 … … 2184 2186 partial void OnRecurringIdChanging(System.Guid value); 2185 2187 partial void OnRecurringIdChanged(); 2188 partial void OnDowntimeTypeChanging(global::HeuristicLab.Services.Hive.DataAccess.DowntimeType value); 2189 partial void OnDowntimeTypeChanged(); 2186 2190 #endregion 2187 2191 … … 2332 2336 this.SendPropertyChanged("RecurringId"); 2333 2337 this.OnRecurringIdChanged(); 2338 } 2339 } 2340 } 2341 2342 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Type", DbType="VarChar(MAX)", CanBeNull=false)] 2343 public global::HeuristicLab.Services.Hive.DataAccess.DowntimeType DowntimeType 2344 { 2345 get 2346 { 2347 return this._Type; 2348 } 2349 set 2350 { 2351 if ((this._Type != value)) 2352 { 2353 this.OnDowntimeTypeChanging(value); 2354 this.SendPropertyChanging(); 2355 this._Type = value; 2356 this.SendPropertyChanged("DowntimeType"); 2357 this.OnDowntimeTypeChanged(); 2334 2358 } 2335 2359 } -
branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql
r8707 r8995 75 75 [Recurring] Bit NOT NULL, 76 76 [RecurringId] UniqueIdentifier NOT NULL, 77 [DowntimeType] VarChar(MAX) NOT NULL, 77 78 CONSTRAINT [PK_dbo.Downtime] PRIMARY KEY ([DowntimeId]) 78 79 ) -
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.