Free cookie consent management tool by TermsFeed Policy Generator

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

#1712 merged trunk into branch

Location:
branches/HiveTaskScheduler/HeuristicLab.Services.Hive
Files:
6 edited

Legend:

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

  • 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.