Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/19/10 15:47:46 (14 years ago)
Author:
cneumuel
Message:

renamed all database entities from "Client" to "Slave" (#1157)
made slave-heartbeats synchronous, also they send HBs when timetable disallows them to calculate. they will appear on the server as Idle bis IsAllowedToCalculate will be false (#1159)

Location:
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3
Files:
5 edited

Legend:

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

    r4253 r4267  
    4747
    4848    public Core Core { get; set; }   
    49     private ClientDto hardwareInfo;       
     49    private SlaveDto hardwareInfo;       
    5050
    5151    /// <summary>
     
    5353    /// </summary>
    5454    private ConfigManager() {     
    55       hardwareInfo = new ClientDto();
     55      hardwareInfo = new SlaveDto();
    5656
    5757      if (Settings.Default.Guid == Guid.Empty) {
     
    7171    /// </summary>
    7272    /// <returns>the ClientInfo object</returns>
    73     public ClientDto GetClientInfo() {
     73    public SlaveDto GetClientInfo() {
    7474      hardwareInfo.Login = WcfService.Instance.ConnectedSince;
    7575      return hardwareInfo;         
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/ConfigurationManager/UptimeManager.cs

    r4263 r4267  
    8484    }
    8585
    86     public bool IsOnline() {
     86    public bool IsAllowedToCalculate() {
    8787      return AppContainer.Appointments.Any(app => (DateTime.Now >= app.StartDate) && (DateTime.Now <= app.EndDate));
    8888    }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/Core.cs

    r4264 r4267  
    220220        byte[] sJob = engines[jId].GetFinishedJob();
    221221
    222         if (WcfService.Instance.ConnState == NetworkEnum.WcfConnState.Loggedin) {
     222        if (WcfService.Instance.LoggedIn) {
    223223          Logger.Info("Sending the finished job with id: " + jId);
    224224          wcfService.GetFinishedJobResultAsync(ConfigManager.Instance.GetClientInfo().Id, jId, sJob, 1.0, engines[jId].CurrentException, true);
     
    247247      //Uptime Limit reached, now is a good time to destroy this jobs.
    248248      Logger.Debug("Checking if uptime limit is reached");
    249       if (!UptimeManager.Instance.IsOnline()) {
     249      if (!UptimeManager.Instance.IsAllowedToCalculate()) {
    250250        Logger.Debug("Uptime limit reached");
    251251        Logger.Debug("Killing Appdomain");
     
    394394      //if the fetching from the server failed - still set the client online... maybe we get
    395395      //a result within the next few heartbeats     
    396       if (!UptimeManager.Instance.CalendarAvailable || UptimeManager.Instance.IsOnline()) {
    397         Logger.Info("CalendarAvailable is " + UptimeManager.Instance.CalendarAvailable + " and IsOnline is: " + UptimeManager.Instance.IsOnline());
     396      //if (!UptimeManager.Instance.CalendarAvailable || UptimeManager.Instance.IsOnline()) {
     397        Logger.Info("CalendarAvailable is " + UptimeManager.Instance.CalendarAvailable + " and IsOnline is: " + UptimeManager.Instance.IsAllowedToCalculate());
    398398        Logger.Info("Setting client online");
    399399        wcfService.LoginSync(ConfigManager.Instance.GetClientInfo());
    400400        JobStorageManager.CheckAndSubmitJobsFromDisc();
    401401        CurrentlyFetching = false;
    402       }
     402      //}
    403403    }
    404404
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/Heartbeat.cs

    r4264 r4267  
    7979            // check if cwfService is disconnected for any reason (should happen at first heartbeat)
    8080            // [chn] TODO: Client should always send heartbeats. when calendar disallows he should tell the server he does not want to compute anything
    81             if (wcfService.ConnState == NetworkEnum.WcfConnState.Disconnected) {
    82               wcfService.Connect();
     81            if (wcfService.ConnState != NetworkEnum.WcfConnState.Connected) {
     82              wcfService.Connect(); // Login happens automatically upon successufl connection
     83            }
     84            if (!wcfService.LoggedIn) {
     85              wcfService.LoginSync(ConfigManager.Instance.GetClientInfo()); // if login faild previously try again
    8386            }
    8487
    85             if (wcfService.ConnState == NetworkEnum.WcfConnState.Loggedin) {
    86 
    87               // client is allowed to calculate stuff
    88               ClientDto info = ConfigManager.Instance.GetClientInfo();
     88            if (wcfService.LoggedIn) {
     89              SlaveDto info = ConfigManager.Instance.GetClientInfo();
    8990             
    9091              HeartBeatData heartBeatData = new HeartBeatData {
     
    9394                FreeMemory = GetFreeMemory(),
    9495                JobProgress = ConfigManager.Instance.GetProgressOfAllJobs(),
    95                 IsAllowedToCalculate = UptimeManager.Instance.IsOnline() && UptimeManager.Instance.CalendarAvailable
     96                IsAllowedToCalculate = UptimeManager.Instance.IsAllowedToCalculate() && UptimeManager.Instance.CalendarAvailable
    9697              };
    9798
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/JobStorage/JobStorageManager.cs

    r4263 r4267  
    4545    public static void CheckAndSubmitJobsFromDisc() {
    4646      for (int index = storedJobsList.Count; index > 0; index--) {
    47         if (WcfService.Instance.ConnState == NetworkEnum.WcfConnState.Loggedin && (storedJobsList[index - 1].ServerIP == WcfService.Instance.ServerIP && storedJobsList[index - 1].ServerPort == WcfService.Instance.ServerPort)) {
     47        if (WcfService.Instance.LoggedIn && (storedJobsList[index - 1].ServerIP == WcfService.Instance.ServerIP && storedJobsList[index - 1].ServerPort == WcfService.Instance.ServerPort)) {
    4848          String filename = storedJobsList[index - 1].ServerIP + "." + storedJobsList[index - 1].ServerPort + "." + storedJobsList[index - 1].JobID.ToString();
    4949          Logger.Info("Sending stored job " + storedJobsList[index - 1].JobID + " to the server");
Note: See TracChangeset for help on using the changeset viewer.