Changeset 4135
- Timestamp:
- 08/03/10 11:18:39 (14 years ago)
- Location:
- branches/3.3-HiveMigration/sources/HeuristicLab.Hive
- Files:
-
- 4 added
- 6 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HiveExperiment.cs
r4133 r4135 270 270 } 271 271 272 public void Stop() { 273 this.ExecutionState = Core.ExecutionState.Stopped; 274 foreach (JobItem jobItem in jobItems) { 275 AbortJob(jobItem.JobDto.Id); 276 } 277 OnStopped(); 278 } 279 272 280 private void CreateResultPollingThreads() { 273 281 foreach(JobItem jobItem in JobItems) { 274 resultPollingThreads.Add(jobItem.JobDto.Id, CreateResultPollingThread(jobItem.JobDto)); 282 if (!resultPollingThreads.ContainsKey(jobItem.JobDto.Id)) { 283 resultPollingThreads.Add(jobItem.JobDto.Id, CreateResultPollingThread(jobItem.JobDto)); 284 } 275 285 } 276 286 } … … 280 290 CreateResultPollingThreads(); 281 291 foreach (Thread pollingThread in resultPollingThreads.Values) { 282 pollingThread.Start(); 292 if (pollingThread.ThreadState != System.Threading.ThreadState.Running) { 293 pollingThread.Start(); 294 } 283 295 } 284 296 this.IsPollingResults = true; … … 317 329 } 318 330 319 public void Stop() {320 foreach(JobItem jobItem in jobItems) {321 AbortJob(jobItem.JobDto.Id);322 }323 }324 325 331 public void AbortJob(Guid jobId) { 326 332 IExecutionEngineFacade executionEngineFacade = GetExecutionEngineFacade(); 327 executionEngineFacade.AbortJob(jobId);328 resultPollingThreads[jobId].Interrupt();329 GetJobItemById(jobId).LogMessage("Aborting Job");330 } 333 Response response = executionEngineFacade.AbortJob(jobId); 334 GetJobItemById(jobId).LogMessage("Aborting Job: " + response.StatusMessage); 335 } 336 331 337 #endregion 332 338 … … 387 393 GetJobItemById(job.Id).LogMessage("Response: " + response.StatusMessage); 388 394 389 if (response.Obj != null) { 390 UpdateJobItem(response.Obj); 391 } 395 UpdateJobItem(response.Obj); 396 397 if (response.Obj.State == State.Abort) { 398 // job is aborted, don't poll for results anymore 399 GetJobItemById(job.Id).LogMessage("Job successfully aborted"); 400 return; 401 } 392 402 393 403 // loop while -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/JobItem.cs
r4133 r4135 18 18 public override Image ItemImage { 19 19 get { 20 if (jobDto.State == State.Offline) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Executable Stopped;20 if (jobDto.State == State.Offline) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutablePrepared; 21 21 else if (jobDto.State == State.Idle) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStopped; 22 22 else if (jobDto.State == State.Calculating) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStarted; 23 23 else if (jobDto.State == State.Offline) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStopped; 24 else if (jobDto.State == State.Abort) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStopped; 24 25 else return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event; 25 26 } -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/ClientCommunicator.cs
r4133 r4135 318 318 /// <summary> 319 319 /// Process the Job progress sent by a client 320 /// [chn] this method needs to be refactored, because its a performance hog 321 /// 322 /// what it does: 323 /// (1) find out if the jobs that should be calculated by this client (from db) and compare if they are consistent with what the joblist the client sent 324 /// (2) find out if every job from the joblist really should be calculated by this client 325 /// (3) checks if a job should be aborted and issues Message 326 /// (4) update job-progress and write to db 327 /// (5) if snapshot is requested, issue Message 328 /// 329 /// (6) for each job from DB, check if there is a job from client (again). 330 /// (7) if job matches, it is removed from newAssigneJobs 331 /// (8) if job !matches, job's TTL is reduced by 1, 332 /// (9) if TTL==0, job is set to Abort (save to DB), and Message to Abort job is issued to client 333 /// 334 /// 335 /// 336 /// quirks: 337 /// (1) the response-object is modified during the foreach-loop (only last element counts) 338 /// (2) state Abort results in Finished. This should be: AbortRequested, Aborted. 320 339 /// </summary> 321 340 /// <param name="hbData"></param> -
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.LINQDataAccess/3.3/HeuristicLab.Hive.Server.LINQDataAccess-3.3.csproj
r4133 r4135 152 152 </ItemGroup> 153 153 <ItemGroup> 154 <Content Include="HiveDataContext.xml" /> 154 <Content Include="HiveDataContext.xml"> 155 <SubType>Designer</SubType> 156 </Content> 155 157 </ItemGroup> 156 158 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Note: See TracChangeset
for help on using the changeset viewer.