- Timestamp:
- 03/08/11 14:54:17 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeartbeatManager.cs
r5511 r5636 53 53 54 54 private void AssignJob(Slave slave, Job job) { 55 job.SetState(JobState.Transferring, slave.Id, ""); 56 dao.UpdateJob(job); 55 dao.UpdateJobState(job.Id, JobState.Transferring, slave.Id, null, null); 57 56 dao.UpdateSlave(slave); 58 57 } … … 88 87 // a request to abort the job has been set 89 88 actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id)); 90 } else if (curJob.State != JobState.Calculating) {91 // jobstate was 'Transferring' before, now calculating92 curJob.SetState(JobState.Calculating, heartbeat.SlaveId, "");93 89 } 94 90 dao.UpdateJob(curJob); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
r5633 r5636 36 36 public Guid AddJob(Job job, JobData jobData, IEnumerable<Guid> resourceIds) { 37 37 using (trans.OpenTransaction()) { 38 job.SetState(JobState.Waiting, auth.UserId);39 38 job.Id = dao.AddJob(job); 40 39 jobData.JobId = job.Id; … … 48 47 } 49 48 dao.AddJobData(jobData); 49 dao.UpdateJobState(job.Id, JobState.Waiting, null, auth.UserId, null); 50 50 return jobData.JobId; 51 51 } … … 135 135 } 136 136 137 // [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 138 // [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)] 139 // [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)] 140 public Job UpdateJobState(Guid jobId, JobState jobState, Guid? slaveId, Guid? userId, string exception) { 141 using (trans.OpenTransaction()) { 142 return dao.UpdateJobState(jobId, jobState, slaveId, userId, exception); 143 } 144 } 137 145 #endregion 138 146 … … 235 243 // [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)] 236 244 public List<MessageContainer> Heartbeat(Heartbeat heartbeat) { 237 TriggerLifecycle( );245 TriggerLifecycle(false); 238 246 239 247 using (trans.OpenTransaction()) { … … 391 399 } 392 400 393 public void TriggerLifecycle( ) {401 public void TriggerLifecycle(bool force) { 394 402 using (trans.OpenTransaction()) { 395 403 DateTime lastCleanup = dao.GetLastCleanup(); 396 if ( DateTime.Now - lastCleanup > TimeSpan.FromSeconds(59)) {404 if (force || DateTime.Now - lastCleanup > TimeSpan.FromSeconds(59)) { 397 405 dao.SetLastCleanup(DateTime.Now); 398 406 lifecycleManager.Cleanup(); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/LifecycleManager.cs
r5593 r5636 48 48 var parentJobsToFinish = dao.GetParentJobs(dao.GetResources(x => true).Select(x => x.Id), 0, true); 49 49 foreach (var job in parentJobsToFinish) { 50 job.SetState(JobState.Finished); 51 dao.UpdateJob(job); 50 dao.UpdateJobState(job.Id, JobState.Finished, null, null, string.Empty); 52 51 } 53 52 }
Note: See TracChangeset
for help on using the changeset viewer.