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/HiveJobs/HiveJob.cs

    r6479 r6721  
    3434namespace HeuristicLab.Clients.Hive {
    3535
    36   [Item("Hive Job", "Represents a hive job.")]
     36  [Item("Hive Task", "Represents a hive job.")]
    3737  [StorableClass]
    3838  public class HiveJob : NamedItem, IItemTree<HiveJob> {
     
    4545          return HeuristicLab.Common.Resources.VSImageLibrary.Event;
    4646        } else {
    47           if (job.State == JobState.Waiting) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePrepared;
    48           else if (job.State == JobState.Calculating) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStarted;
    49           else if (job.State == JobState.Transferring) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStarted;
    50           else if (job.State == JobState.Paused) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePaused;
    51           else if (job.State == JobState.Aborted) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStopped;
    52           else if (job.State == JobState.Failed) return HeuristicLab.Common.Resources.VSImageLibrary.Error;
    53           else if (job.State == JobState.Finished) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStopped;
     47          if (job.State == TaskState.Waiting) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePrepared;
     48          else if (job.State == TaskState.Calculating) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStarted;
     49          else if (job.State == TaskState.Transferring) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStarted;
     50          else if (job.State == TaskState.Paused) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePaused;
     51          else if (job.State == TaskState.Aborted) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStopped;
     52          else if (job.State == TaskState.Failed) return HeuristicLab.Common.Resources.VSImageLibrary.Error;
     53          else if (job.State == TaskState.Finished) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStopped;
    5454          else return HeuristicLab.Common.Resources.VSImageLibrary.Event;
    5555        }
     
    5858
    5959    [Storable]
    60     protected Job job;
    61     public Job Job {
     60    protected Task job;
     61    public Task Job {
    6262      get { return job; }
    6363      set {
     
    154154    #region Constructors and Cloning
    155155    public HiveJob() {
    156       this.Job = new Job() { CoresNeeded = 1, MemoryNeeded = 0 };
    157       job.State = JobState.Offline;
     156      this.Job = new Task() { CoresNeeded = 1, MemoryNeeded = 0 };
     157      job.State = TaskState.Offline;
    158158      this.childHiveJobs = new ItemList<HiveJob>();
    159159      syncJobsWithOptimizers = true;
     
    168168    }
    169169
    170     public HiveJob(Job job, JobData jobData, bool autoCreateChildHiveJobs) {
     170    public HiveJob(Task job, TaskData jobData, bool autoCreateChildHiveJobs) {
    171171      this.syncJobsWithOptimizers = autoCreateChildHiveJobs;
    172172      this.Job = job;
     
    251251    }
    252252
    253     public virtual void UpdateFromLightweightJob(LightweightJob lightweightJob) {
     253    public virtual void UpdateFromLightweightJob(LightweightTask lightweightJob) {
    254254      if (lightweightJob != null) {
    255255        job.Id = lightweightJob.Id;
    256         job.ParentJobId = lightweightJob.ParentJobId;
     256        job.ParentTaskId = lightweightJob.ParentTaskId;
    257257        job.ExecutionTime = lightweightJob.ExecutionTime;
    258258        job.State = lightweightJob.State;
     
    268268
    269269    /// <summary>
    270     /// Creates a JobData object containing the Job and the IJob-Object as byte[]
     270    /// Creates a TaskData object containing the Task and the IJob-Object as byte[]
    271271    /// </summary>
    272272    /// <param name="withoutChildOptimizers">
    273273    ///   if true the Child-Optimizers will not be serialized (if the job contains an Experiment)
    274274    /// </param>
    275     public virtual JobData GetAsJobData(bool withoutChildOptimizers, out List<IPluginDescription> plugins) {
     275    public virtual TaskData GetAsJobData(bool withoutChildOptimizers, out List<IPluginDescription> plugins) {
    276276      plugins = new List<IPluginDescription>();
    277277      if (this.itemJob == null)
     
    280280      IEnumerable<Type> usedTypes;
    281281      byte[] jobByteArray = PersistenceUtil.Serialize(this.ItemJob, out usedTypes);
    282       JobData jobData = new JobData() { JobId = job.Id, Data = jobByteArray };
     282      TaskData jobData = new TaskData() { TaskId = job.Id, Data = jobByteArray };
    283283      PluginUtil.CollectDeclaringPlugins(plugins, usedTypes);
    284284      return jobData;
     
    478478    public void Restart() {
    479479      ServiceLocator.Instance.CallHiveService(service => {
    480         JobData jobData = new JobData();
    481         jobData.JobId = this.job.Id;
     480        TaskData jobData = new TaskData();
     481        jobData.TaskId = this.job.Id;
    482482        jobData.Data = PersistenceUtil.Serialize(this.itemJob);
    483483        service.UpdateJobData(this.Job, jobData);
    484484        service.RestartJob(this.job.Id);
    485         Job job = service.GetJob(this.job.Id);
     485        Task job = service.GetJob(this.job.Id);
    486486        this.job.LastJobDataUpdate = job.LastJobDataUpdate;
    487487      });
     
    504504  }
    505505
    506   [Item("Hive Job", "Represents a hive job.")]
     506  [Item("Hive Task", "Represents a hive job.")]
    507507  [StorableClass]
    508508  public class HiveJob<T> : HiveJob where T : ItemJob {
Note: See TracChangeset for help on using the changeset viewer.