Changeset 5793 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentClient.cs
- Timestamp:
- 03/22/11 15:54:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentClient.cs
r5786 r5793 495 495 jobResultPoller.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobResultPoller_ExceptionOccured); 496 496 jobResultPoller.JobResultsReceived += new EventHandler<EventArgs<IEnumerable<LightweightJob>>>(jobResultPoller_JobResultReceived); 497 jobResultPoller.PollingStarted += new EventHandler(jobResultPoller_PollingStarted);498 jobResultPoller.PollingFinished += new EventHandler(jobResultPoller_PollingFinished);499 497 jobResultPoller.IsPollingChanged += new EventHandler(jobResultPoller_IsPollingChanged); 500 498 } … … 502 500 jobResultPoller.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(jobResultPoller_ExceptionOccured); 503 501 jobResultPoller.JobResultsReceived -= new EventHandler<EventArgs<IEnumerable<LightweightJob>>>(jobResultPoller_JobResultReceived); 504 jobResultPoller.PollingStarted -= new EventHandler(jobResultPoller_PollingStarted);505 jobResultPoller.PollingFinished -= new EventHandler(jobResultPoller_PollingFinished);506 502 jobResultPoller.IsPollingChanged -= new EventHandler(jobResultPoller_IsPollingChanged); 507 503 } 508 504 private void jobResultPoller_IsPollingChanged(object sender, EventArgs e) { 509 505 this.IsPollingResults = jobResultPoller.IsPolling; 510 }511 private void jobResultPoller_PollingFinished(object sender, EventArgs e) {512 LogMessage("Polling results finished");513 }514 private void jobResultPoller_PollingStarted(object sender, EventArgs e) {515 LogMessage("Polling results started");516 506 } 517 507 private void jobResultPoller_JobResultReceived(object sender, EventArgs<IEnumerable<LightweightJob>> e) { … … 527 517 OptimizerJob optimizerJob = LoadOptimizerJob(hj.Job.Id); 528 518 if (optimizerJob == null) { 529 // something bad happened to this job. set to finished to allow the rest beeing downloaded 530 //hj.IsFinishedOptimizerDownloaded = true; 519 // something bad happened to this job. bad job, BAAAD job! 531 520 } else { 532 521 // if the job is paused, download but don't integrate into parent optimizer (to avoid Prepare) 533 522 if (hj.Job.State == JobState.Paused) { 534 523 hj.OptimizerJob = optimizerJob; 535 524 } else { 536 525 if (lightweightJob.ParentJobId.HasValue) { 537 526 HiveJob parentHiveJob = HiveJob.GetHiveJobByJobId(lightweightJob.ParentJobId.Value); 538 527 parentHiveJob.UpdateChildOptimizer(optimizerJob, hj.Job.Id); 539 } else {540 //this.HiveJob.IsFinishedOptimizerDownloaded = true;541 528 } 542 529 } … … 554 541 555 542 private bool AllJobsFinished() { 556 //return HiveJob.GetAllHiveJobs().All(hj => hj.IsFinishedOptimizerDownloaded);557 543 return HiveJob.GetAllHiveJobs().All(j => j.Job.State == JobState.Finished 558 544 || j.Job.State == JobState.Aborted … … 623 609 this.HiveJob = allHiveJobs[this.rootJobId]; 624 610 625 626 //// download them first627 //IDictionary<Guid, Job> allJobs = new Dictionary<Guid, Job>();628 //IDictionary<Guid, JobData> allJobDatas = new Dictionary<Guid, JobData>();629 //foreach (LightweightJob lightweightJob in allResults) {630 // jobCount++;631 // progress.Status = string.Format("Downloading {0} of {1} jobs...", jobCount, totalJobCount);632 // allJobs.Add(lightweightJob.Id, service.GetJob(lightweightJob.Id));633 // allJobDatas.Add(lightweightJob.Id, service.GetJobData(lightweightJob.Id));634 // progress.ProgressValue = (double)jobCount / totalJobCount;635 //}636 637 //jobCount = 1;638 //progress.Status = string.Format("Deserializing {0} of {1} jobs... ({2} kb)", jobCount, totalJobCount, allJobDatas[this.rootJobId].Data.Count() / 1024);639 //this.HiveJob = new HiveJob(allJobs[this.rootJobId], allJobDatas[this.rootJobId], false);640 //allJobDatas.Remove(this.rootJobId); // reduce memory footprint641 //allJobs.Remove(this.rootJobId);642 //progress.ProgressValue = (double)jobCount / totalJobCount;643 644 645 611 if (this.HiveJob.Job.DateFinished.HasValue && this.HiveJob.Job.DateCreated.HasValue) { 646 612 this.ExecutionTime = this.HiveJob.Job.DateFinished.Value - this.HiveJob.Job.DateCreated.Value; … … 656 622 657 623 // build child-job tree 658 //LoadChildResults(service, this.HiveJob, allResults, allJobs, allJobDatas, progress, totalJobCount, ref jobCount);659 624 BuildHiveJobTree(this.HiveJob, allJobs, allHiveJobs); 660 625 StartResultPolling(); … … 739 704 return pluginDatas; 740 705 } 741 742 /// <summary>743 /// Gets the Ids of all plugins needed for executing the job.744 /// All loaded plugins are assumed to be necessary.745 /// If a plugin with the same name and version is already online, it is used. Otherwise the local plugin is uploaded.746 /// If useLocalPlugins is true, all local plugins are uploaded regardless of the existence of the same plugin online.747 /// </summary>748 //public static List<Guid> GetPluginsNeededIds(bool useLocalPlugins) {749 // IEnumerable<IPluginDescription> localPlugins = ApplicationManager.Manager.Plugins;750 // List<Guid> pluginsNeededIds = new List<Guid>();751 752 // using (var service = ServiceLocator.Instance.GetService()) {753 // IEnumerable<Plugin> onlinePlugins = service.Obj.GetPlugins();754 755 // foreach (IPluginDescription localPlugin in localPlugins) {756 // Plugin found = onlinePlugins.Where(onlinePlugin => onlinePlugin.Name == localPlugin.Name && onlinePlugin.Version == localPlugin.Version).SingleOrDefault();757 // if (!useLocalPlugins && found != null) {758 // // plugin is available online; reuse759 // pluginsNeededIds.Add(found.Id);760 // } else {761 // // upload the plugin762 // Plugin p = new Plugin() { Name = localPlugin.Name, Version = localPlugin.Version, IsLocal = useLocalPlugins };763 // List<PluginData> pluginDatas = new List<PluginData>();764 765 // foreach (IPluginFile pf in localPlugin.Files) {766 // PluginData pluginData = new PluginData();767 768 // pluginData.Data = File.ReadAllBytes(pf.Name);769 // pluginDatas.Add(pluginData);770 // }771 // pluginsNeededIds.Add(service.Obj.AddPlugin(p, pluginDatas));772 // }773 // }774 // }775 // return pluginsNeededIds;776 //}777 706 #endregion 778 707
Note: See TracChangeset
for help on using the changeset viewer.