Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/19/10 13:30:56 (14 years ago)
Author:
cneumuel
Message:

Split up "State" to "JobState" and "SlaveState" (#1159)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/Core.cs

    r4263 r4264  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Hive.Slave.ExecutionEngine;
     24using System.IO;
     25using System.Threading;
     26using HeuristicLab.Core;
     27using HeuristicLab.Hive.Contracts;
     28using HeuristicLab.Hive.Contracts.BusinessObjects;
     29using HeuristicLab.Hive.Contracts.ResponseObjects;
    2730using HeuristicLab.Hive.Slave.Common;
    28 using System.Threading;
    29 using System.Reflection;
    30 using System.Diagnostics;
    31 using System.Security.Permissions;
    32 using System.Security.Policy;
    33 using System.Security;
    3431using HeuristicLab.Hive.Slave.Communication;
    35 using HeuristicLab.Hive.Contracts.BusinessObjects;
    36 using HeuristicLab.Hive.Contracts;
    37 using System.Runtime.Remoting.Messaging;
    38 using HeuristicLab.PluginInfrastructure;
    39 using System.ServiceModel;
    40 using System.ServiceModel.Description;
     32using HeuristicLab.Hive.Slave.Communication.ServerService;
    4133using HeuristicLab.Hive.Slave.Core.ClientConsoleService;
    4234using HeuristicLab.Hive.Slave.Core.ConfigurationManager;
    43 using HeuristicLab.Hive.Slave.Communication.ServerService;
    44 using HeuristicLab.Hive.JobBase;
    4535using HeuristicLab.Hive.Slave.Core.JobStorage;
     36using HeuristicLab.Hive.Slave.ExecutionEngine;
    4637using HeuristicLab.Tracing;
    47 using HeuristicLab.Core;
    48 using System.IO;
    49 using HeuristicLab.Hive.Contracts.ResponseObjects;
    5038
    5139namespace HeuristicLab.Hive.Slave.Core {
     
    10290
    10391      //Initialize the heartbeat
    104       beat = new Heartbeat { Interval = 10000 };
     92      beat = new Heartbeat { Interval = new TimeSpan(0, 0, 10) };
    10593      beat.StartHeartbeat();
    10694
     
    171159          Logger.Info("Uptime Limit reached, storing jobs and sending them back");
    172160
    173           //check if there are running jobs
    174           if (engines.Count > 0) {
    175             //make sure there is no more fetching of jobs while the snapshots get processed
    176             CurrentlyFetching = true;
    177             //request a snapshot of each running job
    178             foreach (KeyValuePair<Guid, Executor> kvp in engines) {
    179               kvp.Value.RequestSnapshot();
    180             }
    181 
    182           } else {
    183             //Disconnect afterwards
    184             WcfService.Instance.Disconnect();
    185           }
     161          ShutdownRunningJobsAndSubmitSnapshots();
    186162          break;
    187163
     
    209185          WcfService.Instance.Logout(ConfigManager.Instance.GetClientInfo().Id);
    210186          break;
     187      }
     188    }
     189
     190    private void ShutdownRunningJobsAndSubmitSnapshots() {
     191      //check if there are running jobs
     192      if (engines.Count > 0) {
     193        //make sure there is no more fetching of jobs while the snapshots get processed
     194        CurrentlyFetching = true;
     195        //request a snapshot of each running job
     196        foreach (KeyValuePair<Guid, Executor> kvp in engines) {
     197          kvp.Value.RequestSnapshot();
     198        }
     199
    211200      }
    212201    }
Note: See TracChangeset for help on using the changeset viewer.