Changeset 6721 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/HiveJobs/HiveJob.cs
- Timestamp:
- 09/08/11 13:41:25 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/HiveJobs/HiveJob.cs
r6479 r6721 34 34 namespace HeuristicLab.Clients.Hive { 35 35 36 [Item("Hive Job", "Represents a hive job.")]36 [Item("Hive Task", "Represents a hive job.")] 37 37 [StorableClass] 38 38 public class HiveJob : NamedItem, IItemTree<HiveJob> { … … 45 45 return HeuristicLab.Common.Resources.VSImageLibrary.Event; 46 46 } 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; 54 54 else return HeuristicLab.Common.Resources.VSImageLibrary.Event; 55 55 } … … 58 58 59 59 [Storable] 60 protected Jobjob;61 public JobJob {60 protected Task job; 61 public Task Job { 62 62 get { return job; } 63 63 set { … … 154 154 #region Constructors and Cloning 155 155 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; 158 158 this.childHiveJobs = new ItemList<HiveJob>(); 159 159 syncJobsWithOptimizers = true; … … 168 168 } 169 169 170 public HiveJob( Job job, JobData jobData, bool autoCreateChildHiveJobs) {170 public HiveJob(Task job, TaskData jobData, bool autoCreateChildHiveJobs) { 171 171 this.syncJobsWithOptimizers = autoCreateChildHiveJobs; 172 172 this.Job = job; … … 251 251 } 252 252 253 public virtual void UpdateFromLightweightJob(Lightweight JoblightweightJob) {253 public virtual void UpdateFromLightweightJob(LightweightTask lightweightJob) { 254 254 if (lightweightJob != null) { 255 255 job.Id = lightweightJob.Id; 256 job.Parent JobId = lightweightJob.ParentJobId;256 job.ParentTaskId = lightweightJob.ParentTaskId; 257 257 job.ExecutionTime = lightweightJob.ExecutionTime; 258 258 job.State = lightweightJob.State; … … 268 268 269 269 /// <summary> 270 /// Creates a JobData object containing the Joband the IJob-Object as byte[]270 /// Creates a TaskData object containing the Task and the IJob-Object as byte[] 271 271 /// </summary> 272 272 /// <param name="withoutChildOptimizers"> 273 273 /// if true the Child-Optimizers will not be serialized (if the job contains an Experiment) 274 274 /// </param> 275 public virtual JobData GetAsJobData(bool withoutChildOptimizers, out List<IPluginDescription> plugins) {275 public virtual TaskData GetAsJobData(bool withoutChildOptimizers, out List<IPluginDescription> plugins) { 276 276 plugins = new List<IPluginDescription>(); 277 277 if (this.itemJob == null) … … 280 280 IEnumerable<Type> usedTypes; 281 281 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 }; 283 283 PluginUtil.CollectDeclaringPlugins(plugins, usedTypes); 284 284 return jobData; … … 478 478 public void Restart() { 479 479 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; 482 482 jobData.Data = PersistenceUtil.Serialize(this.itemJob); 483 483 service.UpdateJobData(this.Job, jobData); 484 484 service.RestartJob(this.job.Id); 485 Jobjob = service.GetJob(this.job.Id);485 Task job = service.GetJob(this.job.Id); 486 486 this.job.LastJobDataUpdate = job.LastJobDataUpdate; 487 487 }); … … 504 504 } 505 505 506 [Item("Hive Job", "Represents a hive job.")]506 [Item("Hive Task", "Represents a hive job.")] 507 507 [StorableClass] 508 508 public class HiveJob<T> : HiveJob where T : ItemJob {
Note: See TracChangeset
for help on using the changeset viewer.