Changeset 7218 for trunk/sources
- Timestamp:
- 12/21/11 10:34:36 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Clients.Hive/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveJobs/HiveTask.cs
r7201 r7218 360 360 childHiveTasksLock.EnterReadLock(); 361 361 try { 362 var jobs = new List<HiveTask>();363 jobs.Add(this);362 var tasks = new List<HiveTask>(); 363 tasks.Add(this); 364 364 foreach (HiveTask child in this.childHiveTasks) { 365 jobs.AddRange(child.GetAllHiveTasks());366 } 367 return jobs;365 tasks.AddRange(child.GetAllHiveTasks()); 366 } 367 return tasks; 368 368 } 369 369 finally { childHiveTasksLock.ExitReadLock(); } … … 405 405 } 406 406 407 public void RemoveByTaskId(Guid jobId) {407 public void RemoveByTaskId(Guid taskId) { 408 408 childHiveTasksLock.EnterWriteLock(); 409 409 try { 410 IEnumerable<HiveTask> jobs = childHiveTasks.Where(j => j.Task.Id == jobId).ToList();411 foreach (HiveTask j in jobs) {412 this.childHiveTasks.Remove( j);410 IEnumerable<HiveTask> tasks = childHiveTasks.Where(j => j.Task.Id == taskId).ToList(); 411 foreach (HiveTask t in tasks) { 412 this.childHiveTasks.Remove(t); 413 413 } 414 414 foreach (HiveTask child in childHiveTasks) { 415 child.RemoveByTaskId( jobId);415 child.RemoveByTaskId(taskId); 416 416 } 417 417 } -
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveJobs/OptimizerHiveTask.cs
r7177 r7218 185 185 /// add the runs from the optimizerTask to the batchrun and replace the Optimizer 186 186 /// </summary> 187 public override void IntegrateChild(ItemTask task, Guid child JobId) {187 public override void IntegrateChild(ItemTask task, Guid childTaskId) { 188 188 var optimizerTask = (OptimizerTask)task; 189 189 syncTasksWithOptimizers = false; // don't sync with optimizers during this method … … 198 198 199 199 childHiveTasksLock.EnterReadLock(); 200 OptimizerHiveTask child = (OptimizerHiveTask)this.ChildHiveTasks.Single(j => j.Task.Id == child JobId);200 OptimizerHiveTask child = (OptimizerHiveTask)this.ChildHiveTasks.Single(j => j.Task.Id == childTaskId); 201 201 try { 202 202 if (!optimizerTask.ComputeInParallel) { … … 329 329 } 330 330 331 public OptimizerHiveTask GetChildByOptimizer Job(OptimizerTask optimizerJob) {331 public OptimizerHiveTask GetChildByOptimizerTask(OptimizerTask optimizerTask) { 332 332 childHiveTasksLock.EnterReadLock(); 333 333 try { 334 334 foreach (OptimizerHiveTask child in childHiveTasks) { 335 if (child.ItemTask == optimizer Job)335 if (child.ItemTask == optimizerTask) 336 336 return child; 337 337 } -
trunk/sources/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs
r7115 r7218 265 265 private void jobResultPoller_JobResultReceived(object sender, EventArgs<IEnumerable<LightweightTask>> e) { 266 266 foreach (LightweightTask lightweightTask in e.Value) { 267 HiveTask hiveTask = GetHive JobById(lightweightTask.Id);267 HiveTask hiveTask = GetHiveTaskById(lightweightTask.Id); 268 268 if (hiveTask != null) { 269 269 // lastJobDataUpdate equals DateTime.MinValue right after it was uploaded. When the first results are polled, this value is updated … … 279 279 jobDownloader.DownloadTaskData(hiveTask.Task, (localJob, itemJob) => { 280 280 log.LogMessage(string.Format("Finished downloading task {0}", localJob.Id)); 281 HiveTask localHiveTask = GetHive JobById(localJob.Id);281 HiveTask localHiveTask = GetHiveTaskById(localJob.Id); 282 282 283 283 if (itemJob == null) { … … 294 294 } else { 295 295 if (localJob.ParentTaskId.HasValue) { 296 HiveTask parentHiveTask = GetHive JobById(localJob.ParentTaskId.Value);296 HiveTask parentHiveTask = GetHiveTaskById(localJob.ParentTaskId.Value); 297 297 parentHiveTask.IntegrateChild(itemJob, localJob.Id); 298 298 } else { … … 317 317 } 318 318 319 public HiveTask GetHive JobById(Guid jobId) {320 foreach (HiveTask jobin this.HiveTasks) {321 var hj = job.GetHiveTaskByTaskId(jobId);319 public HiveTask GetHiveTaskById(Guid jobId) { 320 foreach (HiveTask t in this.HiveTasks) { 321 var hj = t.GetHiveTaskByTaskId(jobId); 322 322 if (hj != null) 323 323 return hj;
Note: See TracChangeset
for help on using the changeset viewer.