Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/08/11 13:41:25 (13 years ago)
Author:
ascheibe
Message:

#1233 Review comments: renamed Job to Task

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/RefreshableHiveExperiment.cs

    r6479 r6721  
    225225    }
    226226    #endregion
    227    
     227
    228228    #region JobResultPoller Events
    229229
     
    248248    private void RegisterResultPollingEvents() {
    249249      jobResultPoller.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobResultPoller_ExceptionOccured);
    250       jobResultPoller.JobResultsReceived += new EventHandler<EventArgs<IEnumerable<LightweightJob>>>(jobResultPoller_JobResultReceived);
     250      jobResultPoller.JobResultsReceived += new EventHandler<EventArgs<IEnumerable<LightweightTask>>>(jobResultPoller_JobResultReceived);
    251251      jobResultPoller.IsPollingChanged += new EventHandler(jobResultPoller_IsPollingChanged);
    252252    }
    253253    private void DeregisterResultPollingEvents() {
    254254      jobResultPoller.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(jobResultPoller_ExceptionOccured);
    255       jobResultPoller.JobResultsReceived -= new EventHandler<EventArgs<IEnumerable<LightweightJob>>>(jobResultPoller_JobResultReceived);
     255      jobResultPoller.JobResultsReceived -= new EventHandler<EventArgs<IEnumerable<LightweightTask>>>(jobResultPoller_JobResultReceived);
    256256      jobResultPoller.IsPollingChanged -= new EventHandler(jobResultPoller_IsPollingChanged);
    257257    }
     
    262262      }
    263263    }
    264     private void jobResultPoller_JobResultReceived(object sender, EventArgs<IEnumerable<LightweightJob>> e) {
    265       foreach (LightweightJob lightweightJob in e.Value) {
     264    private void jobResultPoller_JobResultReceived(object sender, EventArgs<IEnumerable<LightweightTask>> e) {
     265      foreach (LightweightTask lightweightJob in e.Value) {
    266266        HiveJob hiveJob = GetHiveJobById(lightweightJob.Id);
    267267        if (hiveJob != null) {
    268268          // lastJobDataUpdate equals DateTime.MinValue right after it was uploaded. When the first results are polled, this value is updated
    269           if (hiveJob.Job.State == JobState.Offline && lightweightJob.State != JobState.Finished && lightweightJob.State != JobState.Failed && lightweightJob.State != JobState.Aborted) {
     269          if (hiveJob.Job.State == TaskState.Offline && lightweightJob.State != TaskState.Finished && lightweightJob.State != TaskState.Failed && lightweightJob.State != TaskState.Aborted) {
    270270            hiveJob.Job.LastJobDataUpdate = lightweightJob.LastJobDataUpdate;
    271271          }
     
    289289                // if the job is paused, download but don't integrate into parent optimizer (to avoid Prepare)
    290290
    291                 if (localJob.State == JobState.Paused) {
     291                if (localJob.State == TaskState.Paused) {
    292292                  localHiveJob.ItemJob = itemJob;
    293293                } else {
    294                   if (localJob.ParentJobId.HasValue) {
    295                     HiveJob parentHiveJob = GetHiveJobById(localJob.ParentJobId.Value);
     294                  if (localJob.ParentTaskId.HasValue) {
     295                    HiveJob parentHiveJob = GetHiveJobById(localJob.ParentTaskId.Value);
    296296                    parentHiveJob.IntegrateChild(itemJob, localJob.Id);
    297297                  } else {
     
    327327      var jobs = this.GetAllHiveJobs();
    328328      hiveExperiment.JobCount = jobs.Count();
    329       hiveExperiment.CalculatingCount = jobs.Count(j => j.Job.State == JobState.Calculating);
    330       hiveExperiment.FinishedCount = jobs.Count(j => j.Job.State == JobState.Finished);
     329      hiveExperiment.CalculatingCount = jobs.Count(j => j.Job.State == TaskState.Calculating);
     330      hiveExperiment.FinishedCount = jobs.Count(j => j.Job.State == TaskState.Finished);
    331331      OnJobStatisticsChanged();
    332332    }
    333333
    334334    public bool AllJobsFinished() {
    335       return this.GetAllHiveJobs().All(j => (j.Job.State == JobState.Finished
    336                                                    || j.Job.State == JobState.Aborted
    337                                                    || j.Job.State == JobState.Failed)
     335      return this.GetAllHiveJobs().All(j => (j.Job.State == TaskState.Finished
     336                                                   || j.Job.State == TaskState.Aborted
     337                                                   || j.Job.State == TaskState.Failed)
    338338                                                   && j.IsFinishedJobDownloaded);
    339339    }
Note: See TracChangeset for help on using the changeset viewer.