Changeset 4267 for branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3
- Timestamp:
- 08/19/10 15:47:46 (14 years ago)
- 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 47 47 48 48 public Core Core { get; set; } 49 private ClientDto hardwareInfo;49 private SlaveDto hardwareInfo; 50 50 51 51 /// <summary> … … 53 53 /// </summary> 54 54 private ConfigManager() { 55 hardwareInfo = new ClientDto();55 hardwareInfo = new SlaveDto(); 56 56 57 57 if (Settings.Default.Guid == Guid.Empty) { … … 71 71 /// </summary> 72 72 /// <returns>the ClientInfo object</returns> 73 public ClientDto GetClientInfo() {73 public SlaveDto GetClientInfo() { 74 74 hardwareInfo.Login = WcfService.Instance.ConnectedSince; 75 75 return hardwareInfo; -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/ConfigurationManager/UptimeManager.cs
r4263 r4267 84 84 } 85 85 86 public bool Is Online() {86 public bool IsAllowedToCalculate() { 87 87 return AppContainer.Appointments.Any(app => (DateTime.Now >= app.StartDate) && (DateTime.Now <= app.EndDate)); 88 88 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/Core.cs
r4264 r4267 220 220 byte[] sJob = engines[jId].GetFinishedJob(); 221 221 222 if (WcfService.Instance. ConnState == NetworkEnum.WcfConnState.Loggedin) {222 if (WcfService.Instance.LoggedIn) { 223 223 Logger.Info("Sending the finished job with id: " + jId); 224 224 wcfService.GetFinishedJobResultAsync(ConfigManager.Instance.GetClientInfo().Id, jId, sJob, 1.0, engines[jId].CurrentException, true); … … 247 247 //Uptime Limit reached, now is a good time to destroy this jobs. 248 248 Logger.Debug("Checking if uptime limit is reached"); 249 if (!UptimeManager.Instance.Is Online()) {249 if (!UptimeManager.Instance.IsAllowedToCalculate()) { 250 250 Logger.Debug("Uptime limit reached"); 251 251 Logger.Debug("Killing Appdomain"); … … 394 394 //if the fetching from the server failed - still set the client online... maybe we get 395 395 //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.Is Online());396 //if (!UptimeManager.Instance.CalendarAvailable || UptimeManager.Instance.IsOnline()) { 397 Logger.Info("CalendarAvailable is " + UptimeManager.Instance.CalendarAvailable + " and IsOnline is: " + UptimeManager.Instance.IsAllowedToCalculate()); 398 398 Logger.Info("Setting client online"); 399 399 wcfService.LoginSync(ConfigManager.Instance.GetClientInfo()); 400 400 JobStorageManager.CheckAndSubmitJobsFromDisc(); 401 401 CurrentlyFetching = false; 402 }402 //} 403 403 } 404 404 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/Heartbeat.cs
r4264 r4267 79 79 // check if cwfService is disconnected for any reason (should happen at first heartbeat) 80 80 // [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 83 86 } 84 87 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(); 89 90 90 91 HeartBeatData heartBeatData = new HeartBeatData { … … 93 94 FreeMemory = GetFreeMemory(), 94 95 JobProgress = ConfigManager.Instance.GetProgressOfAllJobs(), 95 IsAllowedToCalculate = UptimeManager.Instance.Is Online() && UptimeManager.Instance.CalendarAvailable96 IsAllowedToCalculate = UptimeManager.Instance.IsAllowedToCalculate() && UptimeManager.Instance.CalendarAvailable 96 97 }; 97 98 -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/JobStorage/JobStorageManager.cs
r4263 r4267 45 45 public static void CheckAndSubmitJobsFromDisc() { 46 46 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)) { 48 48 String filename = storedJobsList[index - 1].ServerIP + "." + storedJobsList[index - 1].ServerPort + "." + storedJobsList[index - 1].JobID.ToString(); 49 49 Logger.Info("Sending stored job " + storedJobsList[index - 1].JobID + " to the server");
Note: See TracChangeset
for help on using the changeset viewer.