Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8995


Ignore:
Timestamp:
12/04/12 15:38:44 (11 years ago)
Author:
ascheibe
Message:

#1712 merged trunk into branch

Location:
branches/HiveTaskScheduler
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/HiveTaskScheduler/HeuristicLab.Services.Hive

  • branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess

  • branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj

    r8600 r8995  
    9999    <None Include="Plugin.cs.frame" />
    100100    <Compile Include="Enums\Command.cs" />
     101    <Compile Include="Enums\DowntimeType.cs" />
    101102    <Compile Include="Enums\CpuArchitecture.cs" />
    102103    <Compile Include="Plugin.cs" />
     
    156157  </PropertyGroup>
    157158  <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)
    159160set ProjectDir=$(ProjectDir)
    160161set SolutionDir=$(SolutionDir)
     
    162163
    163164call PreBuildEvent.cmd</PreBuildEvent>
    164 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     165    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
    165166export ProjectDir=$(ProjectDir)
    166167export 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
    122using System;
    223using System.Data.Linq.Mapping;
  • branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml

    r8707 r8995  
    9595      <Column Name="Recurring" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
    9696      <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" />
    9798      <Association Name="Resource_Downtime" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
    9899    </Type>
  • branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs

    r8707 r8995  
    21642164    private System.Guid _RecurringId;
    21652165   
     2166    private global::HeuristicLab.Services.Hive.DataAccess.DowntimeType _Type;
     2167   
    21662168    private EntityRef<Resource> _Resource;
    21672169   
     
    21842186    partial void OnRecurringIdChanging(System.Guid value);
    21852187    partial void OnRecurringIdChanged();
     2188    partial void OnDowntimeTypeChanging(global::HeuristicLab.Services.Hive.DataAccess.DowntimeType value);
     2189    partial void OnDowntimeTypeChanged();
    21862190    #endregion
    21872191   
     
    23322336          this.SendPropertyChanged("RecurringId");
    23332337          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();
    23342358        }
    23352359      }
  • branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql

    r8707 r8995  
    7575  [Recurring] Bit NOT NULL,
    7676  [RecurringId] UniqueIdentifier NOT NULL,
     77  [DowntimeType] VarChar(MAX) NOT NULL,
    7778  CONSTRAINT [PK_dbo.Downtime] PRIMARY KEY ([DowntimeId])
    7879  )
  • branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Convert.cs

    r8707 r8995  
    118118    public static DT.Downtime ToDto(DB.Downtime source) {
    119119      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 };
    121121    }
    122122    public static DB.Downtime ToEntity(DT.Downtime source) {
     
    127127    public static void ToEntity(DT.Downtime source, DB.Downtime target) {
    128128      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;
    130130      }
    131131    }
  • branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/DataTransfer/Downtime.cs

    r7259 r8995  
    2222using System;
    2323using System.Runtime.Serialization;
     24using HeuristicLab.Services.Hive.DataAccess;
    2425
    2526namespace HeuristicLab.Services.Hive.DataTransfer {
     
    3839    [DataMember]
    3940    public Guid ResourceId { get; set; }
     41    [DataMember]
     42    public DowntimeType DowntimeType { get; set; }
    4043  }
    4144}
  • branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Manager/HeartbeatManager.cs

    r8707 r8995  
    5050        if (heartbeat.HbInterval != slave.HbInterval) {
    5151          actions.Add(new MessageContainer(MessageContainer.MessageType.NewHBInterval));
     52        }
     53        if (ShutdownSlaveComputer(slave.Id)) {
     54          actions.Add(new MessageContainer(MessageContainer.MessageType.ShutdownComputer));
    5255        }
    5356
     
    165168    private bool SlaveIsAllowedToCalculate(Guid slaveId) {
    166169      // 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);
    168175    }
    169176  }
  • branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/MessageContainer.cs

    r7259 r8995  
    4848      ShutdownSlave,  // slave should shutdown immediately without submitting results
    4949      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
    5152    };
    5253
  • 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
     22namespace HeuristicLab.Services.Hive.Properties {
    223   
    324   
Note: See TracChangeset for help on using the changeset viewer.