Changeset 4649 for branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common
- Timestamp:
- 10/28/10 14:52:56 (14 years ago)
- Location:
- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HiveExperiment.cs
r4629 r4649 30 30 public class HiveExperiment : NamedHiveItem { 31 31 [DataMember] 32 public string ResourceIds { get; set; }33 [DataMember]34 32 public Guid UserId { get; set; } 35 33 [DataMember] … … 37 35 38 36 public override string ToString() { 39 return base.ToString() + "Name: " + Name + ", Description: " + Description + ", ResourceIds: " + ResourceIds;37 return base.ToString() + "Name: " + Name + ", Description: " + Description; 40 38 } 41 39 42 40 public override IDeepCloneable Clone(Cloner cloner) { 43 41 var clone = (HiveExperiment)base.Clone(cloner); 44 clone.ResourceIds = this.ResourceIds;45 42 clone.RootJobId = this.RootJobId; 46 43 clone.UserId = this.UserId; -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HiveItem.cs
r4629 r4649 8 8 namespace HeuristicLab.Services.Hive.Common.DataTransfer { 9 9 [DataContract] 10 public abstract class HiveItem : IDeepCloneable { 10 [Serializable] 11 public abstract class HiveItem : HiveItemBase { 11 12 [DataMember] 12 13 public Guid Id { get; set; } 13 14 14 15 public virtual IDeepCloneable Clone(Cloner cloner) { 15 HiveItem clone = (HiveItem)Activator.CreateInstance(this.GetType(), true); 16 cloner.RegisterClonedObject(this, clone); 16 HiveItem clone = (HiveItem)base.Clone(cloner); 17 17 clone.Id = this.Id; 18 18 return clone; 19 19 } 20 21 public object Clone() {22 return Clone(new Cloner());23 }24 20 } 25 21 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Job.cs
r4629 r4649 27 27 28 28 namespace HeuristicLab.Services.Hive.Common.DataTransfer { 29 30 29 [DataContract] 31 30 [Serializable] … … 40 39 public int MemoryNeeded { get; set; } 41 40 [DataMember] 42 public List<Guid> PluginsNeededIds { get; set; } 43 [DataMember] 44 public List<Guid> AssignedResourceIds { get; set; } 45 [DataMember] 46 public Guid ProjectId { get; set; } 41 public Guid? ProjectId { get; set; } 47 42 48 43 public override string ToString() { 49 return base.ToString() + "State: " + State + ", [SlaveId : " + SlaveId + " ] , DateCreated: " + DateCreated + ", DateCalculated: " + DateCalculated +50 "Priority: " + Priority + ", CoresNeeded: " + CoresNeeded + "AssignedResources: " + AssignedResourceIds;44 return base.ToString() + "State: " + JobState + ", [SlaveId : " + SlaveId + " ] , DateCreated: " + DateCreated + ", DateCalculated: " + DateCalculated + 45 "Priority: " + Priority + ", CoresNeeded: " + CoresNeeded; 51 46 } 52 47 53 48 public Job() { 54 PluginsNeededIds = new List<Guid>();55 AssignedResourceIds = new List<Guid>();56 49 } 57 50 … … 62 55 clone.CoresNeeded = this.CoresNeeded; 63 56 clone.MemoryNeeded = this.MemoryNeeded; 64 clone.PluginsNeededIds = new List<Guid>(this.PluginsNeededIds);65 clone.AssignedResourceIds = new List<Guid>(this.AssignedResourceIds);66 57 clone.ProjectId = this.ProjectId; 67 58 return clone; -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/JobData.cs
r4629 r4649 28 28 [DataContract] 29 29 [Serializable] 30 public class JobData : HiveItem {30 public class JobData : HiveItemBase { 31 31 [DataMember] 32 32 public Guid JobId { get; set; } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/JobState.cs
r4615 r4649 23 23 namespace HeuristicLab.Services.Hive.Common.DataTransfer { 24 24 public enum JobState { 25 /// <summary>26 /// Job is actively calculated on a Slave25 /// <summary> 26 /// A job is offline as long as he is not yet submitted to the hive 27 27 /// </summary> 28 Calculating,28 Offline, 29 29 30 30 /// <summary> … … 33 33 Waiting, 34 34 35 /// <summary> 36 /// The job is paused and waits on the server to be sent back to a Slave when all of its child jobs are Finished. 37 /// </summary> 38 WaitingForChildJobs, 39 40 /// <summary> 41 /// Job is actively calculated on a Slave 42 /// </summary> 43 Calculating, 44 35 45 /// <summary> 36 46 /// Job as finished and is ready to be collected by the Client … … 46 56 /// Job as been aborted due to an error. Results are ready to be collected 47 57 /// </summary> 48 Failed, 49 50 /// <summary> 51 /// The job is paused and waits on the server to be sent back to a Slave when all of its child jobs are Finished. 52 /// </summary> 53 WaitForChildJobs 58 Failed 54 59 }; 55 60 … … 67 72 public static bool IsWaiting(this JobState jobState) { 68 73 return jobState == JobState.Waiting || 69 jobState == JobState.Wait ForChildJobs;74 jobState == JobState.WaitingForChildJobs; 70 75 } 71 76 -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/LightweightJob.cs
r4629 r4649 29 29 public class LightweightJob : HiveItem { 30 30 [DataMember] 31 public Guid SlaveId { get; set; }31 public Guid? SlaveId { get; set; } 32 32 [DataMember] 33 public JobState State { get; set; }33 public JobState JobState { get; set; } 34 34 [DataMember] 35 public TimeSpan ExecutionTime { get; set; }35 public TimeSpan? ExecutionTime { get; set; } 36 36 [DataMember] 37 37 public String Exception { get; set; } … … 45 45 public Guid? ParentJobId { get; set; } 46 46 47 public LightweightJob() { } 47 public LightweightJob() { 48 JobState = DataTransfer.JobState.Offline; 49 } 48 50 49 51 public LightweightJob(Job job) { 50 52 this.SlaveId = job.SlaveId; 51 this. State = job.State;53 this.JobState = job.JobState; 52 54 this.ExecutionTime = job.ExecutionTime; 53 55 this.Exception = job.Exception; … … 61 63 var clone = (LightweightJob)base.Clone(cloner); 62 64 clone.SlaveId = this.SlaveId; 63 clone. State = this.State;65 clone.JobState = this.JobState; 64 66 clone.ExecutionTime = this.ExecutionTime; 65 67 clone.Exception = this.Exception; -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Slave.cs
r4629 r4649 33 33 public int? FreeCores { get; set; } 34 34 [DataMember] 35 public int? CpuSpeed PerCore{ get; set; }35 public int? CpuSpeed { get; set; } 36 36 [DataMember] 37 37 public int? Memory { get; set; } … … 39 39 public int? FreeMemory { get; set; } 40 40 [DataMember] 41 public SlaveState S tate { get; set; }41 public SlaveState SlaveState { get; set; } 42 42 [DataMember] 43 public CalendarState CalendarSyncStat us{ get; set; }43 public CalendarState CalendarSyncState { get; set; } 44 44 [DataMember] 45 public Guid SlaveConfigId { get; set; }45 public Guid? SlaveConfigId { get; set; } 46 46 [DataMember] 47 47 public bool IsAllowedToCalculate { get; set; } 48 48 49 public Slave() { 50 SlaveState = DataTransfer.SlaveState.Idle; 51 } 52 49 53 public override string ToString() { 50 return base.ToString() + ", NrOfCores: " + Cores + ", NrOfFreeCores " + FreeCores + ", State: " + S tate;54 return base.ToString() + ", NrOfCores: " + Cores + ", NrOfFreeCores " + FreeCores + ", State: " + SlaveState; 51 55 } 52 56 … … 55 59 clone.Cores = this.Cores; 56 60 clone.FreeCores = this.FreeCores; 57 clone.CpuSpeed PerCore = this.CpuSpeedPerCore;61 clone.CpuSpeed = this.CpuSpeed; 58 62 clone.Memory = this.Memory; 59 63 clone.FreeMemory = this.FreeMemory; 60 clone.S tate = this.State;61 clone.CalendarSyncStat us = this.CalendarSyncStatus;64 clone.SlaveState = this.SlaveState; 65 clone.CalendarSyncState = this.CalendarSyncState; 62 66 clone.SlaveConfigId = this.SlaveConfigId; 63 67 clone.IsAllowedToCalculate = this.IsAllowedToCalculate; -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/SlaveGroup.cs
r4629 r4649 30 30 public class SlaveGroup : Resource { 31 31 [DataMember] 32 public List<Guid> ResourcesIds { get; set; } 32 public List<Guid> ChildResourcesIds { get; set; } 33 [DataMember] 34 public List<Guid> ParentResourcesIds { get; set; } 33 35 34 36 public SlaveGroup() { 35 ResourcesIds = new List<Guid>();37 ChildResourcesIds = new List<Guid>(); 36 38 } 37 39 38 40 public override IDeepCloneable Clone(Cloner cloner) { 39 41 var clone = (SlaveGroup)base.Clone(cloner); 40 clone.ResourcesIds = new List<Guid>(this.ResourcesIds); 42 clone.ChildResourcesIds = new List<Guid>(this.ChildResourcesIds); 43 clone.ParentResourcesIds = new List<Guid>(this.ParentResourcesIds); 41 44 return clone; 42 45 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/Disposable.cs
r4598 r4649 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 24 25 namespace HeuristicLab.Services.Hive.Common { … … 34 35 35 36 public void Dispose() { 36 if ( OnDisposing != null)37 OnDisposing(this, new EventArgs());37 if (Disposing != null) 38 Disposing(this, new EventArgs<T>(obj)); 38 39 } 39 40 40 public event EventHandler OnDisposing;41 public event EventHandler<EventArgs<T>> Disposing; 41 42 } 42 43 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/HeuristicLab.Services.Hive.Common-3.3.csproj
r4629 r4649 67 67 <Compile Include="DataTransfer\HiveExperiment.cs" /> 68 68 <Compile Include="DataTransfer\HiveItem.cs" /> 69 <Compile Include="DataTransfer\HiveItemBase.cs" /> 69 70 <Compile Include="DataTransfer\HivePluginData.cs" /> 70 71 <Compile Include="DataTransfer\HivePlugin.cs" /> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/ServiceContracts/IHiveService.cs
r4629 r4649 156 156 #region Slave Methods 157 157 [OperationContract] 158 Guid AddSlave(Slave slave); 159 160 [OperationContract] 158 161 Guid AddSlaveGroup(SlaveGroup slaveGroup); 159 162
Note: See TracChangeset
for help on using the changeset viewer.