Changeset 4796
- Timestamp:
- 11/15/10 14:27:27 (14 years ago)
- Location:
- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New
- Files:
-
- 1 added
- 2 deleted
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/HeuristicLab.Clients.Hive-3.3.csproj
r4649 r4796 88 88 <Compile Include="PersistenceUtil.cs" /> 89 89 <Compile Include="ServiceClients\ServiceClientFactory.cs" /> 90 <Compile Include=" ServiceClients\ServiceClientFactoryException.cs" />90 <Compile Include="Exceptions\ServiceClientFactoryException.cs" /> 91 91 <Compile Include="ServiceLocator.cs" /> 92 92 <Compile Include="Properties\Settings.Designer.cs"> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/HiveExperiment/HiveClient.cs
r4649 r4796 31 31 using DT = HeuristicLab.Services.Hive.Common.DataTransfer; 32 32 using HeuristicLab.Common; 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 33 34 34 35 [Item("Hive Client", "Connects to Hive and lists all submitted experiments by the current user.")] … … 67 68 } 68 69 70 public HiveClient() { } 71 protected HiveClient(HiveClient original, Cloner cloner) 72 : base(original, cloner) { 73 this.hiveExperiments = cloner.Clone(original.hiveExperiments); 74 } 75 public override IDeepCloneable Clone(Cloner cloner) { 76 return new HiveClient(this, cloner); 77 } 78 69 79 private void RegisterHiveExperimentsEvent() { 70 80 if (hiveExperiments != null) { … … 77 87 hiveExperiments.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<HiveExperimentClient>>(hiveExperiments_ItemsRemoved); 78 88 } 79 }80 81 public HiveClient() {82 83 }84 85 public override IDeepCloneable Clone(Cloner cloner) {86 HiveClient clone = (HiveClient)base.Clone(cloner);87 clone.hiveExperiments = (ItemList<HiveExperimentClient>)cloner.Clone(this.hiveExperiments);88 return clone;89 89 } 90 90 … … 135 135 if (handler != null) handler(this, EventArgs.Empty); 136 136 } 137 137 138 138 void hiveExperiments_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<HiveExperimentClient>> e) { 139 139 if (!currentlyUpdating) { -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/HiveExperiment/HiveExperimentClient.cs
r4649 r4796 113 113 private JobResultPoller jobResultPoller; 114 114 115 115 116 public HiveExperimentClient() 116 117 : base(itemName, itemDescription) { … … 120 121 InitTimer(); 121 122 } 122 123 123 public HiveExperimentClient(DT.HiveExperiment hiveExperimentDto) 124 124 : this() { 125 125 UpdateFromDto(hiveExperimentDto); 126 126 } 127 protected HiveExperimentClient(HiveExperimentClient original, Cloner cloner) 128 : base(original, cloner) { 129 this.resourceIds = original.resourceIds; 130 this.executionState = original.executionState; 131 this.executionTime = original.executionTime; 132 this.log = cloner.Clone(original.log); 133 this.lastUpdateTime = original.lastUpdateTime; 134 this.rootJobId = original.rootJobId; 135 } 136 public override IDeepCloneable Clone(Cloner cloner) { 137 return new HiveExperimentClient(this, cloner); 138 } 139 127 140 128 141 public void UpdateFromDto(DT.HiveExperiment hiveExperimentDto) { … … 142 155 RootJobId = this.rootJobId 143 156 }; 144 }145 146 public override IDeepCloneable Clone(Cloner cloner) {147 LogMessage("I am beeing cloned");148 HiveExperimentClient clone = (HiveExperimentClient)base.Clone(cloner);149 clone.resourceIds = this.resourceIds;150 clone.executionState = this.executionState;151 clone.executionTime = this.executionTime;152 clone.log = (ILog)cloner.Clone(log);153 clone.lastUpdateTime = this.lastUpdateTime;154 clone.rootJobId = this.rootJobId;155 return clone;156 157 } 157 158 … … 417 418 } 418 419 if (HiveJob != null) { 419 jobResultPoller = new JobResultPoller(HiveJob, ApplicationConstants.R ESULT_POLLING_INTERVAL);420 jobResultPoller = new JobResultPoller(HiveJob, ApplicationConstants.ResultPollingInterval); 420 421 RegisterResultPollingEvents(); 421 422 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/HiveExperiment/HiveJobClient.cs
r4649 r4796 33 33 34 34 namespace HeuristicLab.Clients.Hive { 35 [StorableClass] 35 36 36 public class HiveJob : Item { 37 37 private static object locker = new object(); … … 53 53 } 54 54 55 [Storable]56 55 private Job job; 57 56 public Job Job { … … 67 66 } 68 67 69 [Storable]70 68 private OptimizerJob optimizerJob; 71 69 public OptimizerJob OptimizerJob { … … 87 85 } 88 86 89 [Storable]90 87 private ItemList<HiveJob> childHiveJobs; 91 88 public ReadOnlyItemList<HiveJob> ChildHiveJobs { … … 93 90 } 94 91 95 [Storable]96 92 private bool isFinishedOptimizerDownloaded; 97 93 public bool IsFinishedOptimizerDownloaded { … … 105 101 } 106 102 107 [Storable]108 103 private bool syncJobsWithOptimizers = true; 109 104 … … 138 133 public HiveJob(IOptimizer optimizer) 139 134 : this() { 140 135 this.OptimizerJob = new OptimizerJob(optimizer); 141 136 } 142 137 … … 147 142 this.OptimizerJob = PersistenceUtil.Deserialize<OptimizerJob>(serializedJob.Data); 148 143 this.syncJobsWithOptimizers = true; 144 } 145 146 protected HiveJob(HiveJob original, Cloner cloner) 147 : base(original, cloner) { 148 this.Job = cloner.Clone(original.job); 149 this.OptimizerJob = cloner.Clone(original.OptimizerJob); 150 } 151 public override IDeepCloneable Clone(Cloner cloner) { 152 return new HiveJob(this, cloner); 149 153 } 150 154 … … 212 216 } 213 217 } 214 218 215 219 void batchRun_AlgorithmChanged(object sender, EventArgs e) { 216 220 if (syncJobsWithOptimizers) { … … 484 488 } 485 489 486 public override IDeepCloneable Clone(Cloner cloner) {487 LogMessage("I am beeing cloned");488 HiveJob clone = (HiveJob)base.Clone(cloner);489 clone.job = (Job)cloner.Clone(this.job);490 clone.optimizerJob = (OptimizerJob)cloner.Clone(this.optimizerJob);491 return clone;492 }493 494 490 /// <summary> 495 491 /// Returns a list of HiveJobs including this and all its child-jobs recursively -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/Jobs/OptimizerJob.cs
r4629 r4796 29 29 30 30 namespace HeuristicLab.Clients.Hive.Jobs { 31 [Item("Optimizer Job", "Represents Job which executes a IOptimizer object.")] 31 32 [StorableClass] 32 public class OptimizerJob : IJob {33 public class OptimizerJob : DeepCloneable, IJob { 33 34 [Storable] 34 35 protected IOptimizer optimizer; … … 70 71 } 71 72 72 73 73 [Storable] 74 74 private bool collectChildJobs; … … 81 81 this.log = new Log(); 82 82 } 83 84 83 public OptimizerJob(IOptimizer optimizer) 85 84 : this() { … … 93 92 this.ComputeInParallel = false; 94 93 } 94 } 95 [StorableConstructor] 96 protected OptimizerJob(bool deserializing) { } 97 protected OptimizerJob(OptimizerJob original, Cloner cloner) 98 : base(original, cloner) { 99 this.Optimizer = cloner.Clone(original.Optimizer); 100 this.log = cloner.Clone(original.Log); 101 this.ComputeInParallel = original.ComputeInParallel; 102 this.IndexInParentOptimizerList = original.IndexInParentOptimizerList; 103 this.CollectChildJobs = original.CollectChildJobs; 104 this.RegisterEvents(); 105 } 106 public override IDeepCloneable Clone(Cloner cloner) { 107 return new OptimizerJob(this, cloner); 95 108 } 96 109 … … 310 323 #endregion 311 324 312 #region IDeepCloneable Members313 314 public IDeepCloneable Clone(Cloner cloner) {315 OptimizerJob clone = (OptimizerJob)Activator.CreateInstance(this.GetType());316 cloner.RegisterClonedObject(this, clone);317 clone.Optimizer = (IOptimizer)cloner.Clone(this.Optimizer);318 clone.log = (ILog)cloner.Clone(this.Log);319 clone.ComputeInParallel = this.ComputeInParallel;320 clone.IndexInParentOptimizerList = this.IndexInParentOptimizerList;321 clone.CollectChildJobs = this.CollectChildJobs;322 clone.RegisterEvents();323 return clone;324 }325 326 #endregion327 328 #region ICloneable Members329 330 public object Clone() {331 return Clone(new Cloner());332 }333 334 #endregion335 336 325 /// <summary> 337 326 /// Gets the string representation of the current instance in the format: <c>Name: [null|Value]</c>. -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/ApplicationConstants.cs
r4598 r4796 26 26 public class ApplicationConstants { 27 27 28 public static System.Data.IsolationLevel I SOLATION_LEVEL= IsolationLevel.ReadUncommitted;28 public static System.Data.IsolationLevel IsolationLevel = IsolationLevel.ReadUncommitted; 29 29 30 30 /// <summary> 31 31 /// ReadUncommitted to minimize deadlocks. 32 32 /// </summary> 33 public static System.Transactions.IsolationLevel I SOLATION_LEVEL_SCOPE= System.Transactions.IsolationLevel.ReadUncommitted;33 public static System.Transactions.IsolationLevel IsolationLevelScope = System.Transactions.IsolationLevel.ReadUncommitted; 34 34 35 public static int H EARTBEAT_TIMEOUT= 120; // value in seconds35 public static int HeartbeatTimeout = 120; // value in seconds 36 36 37 public static int J OB_TIME_TO_LIVE= 5;37 public static int JobTimeToLive = 5; 38 38 39 39 /// <summary> 40 40 /// Interval in which the HL.HiveExperiment will poll results from server 41 41 /// </summary> 42 public static TimeSpan R ESULT_POLLING_INTERVAL= new TimeSpan(0, 0, 5);42 public static TimeSpan ResultPollingInterval = new TimeSpan(0, 0, 5); 43 43 44 44 /// <summary> 45 45 /// Maximum number of jobs that the server should send/receive simultaniously 46 46 /// </summary> 47 public static int M AX_JOB_TRANSFER_COUNT= 6;47 public static int MaxJobTransferCount = 6; 48 48 } 49 49 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Appointment.cs
r4629 r4796 40 40 public Guid ResourceId { get; set; } 41 41 42 protected Appointment(Appointment original, Cloner cloner) : base(original, cloner) { 43 this.AllDayEvent = original.AllDayEvent; 44 this.EndDate = original.EndDate; 45 this.Recurring = original.Recurring; 46 this.RecurringId = original.RecurringId; 47 this.ResourceId = original.ResourceId; 48 this.StartDate = original.StartDate; 49 } 42 50 public override IDeepCloneable Clone(Cloner cloner) { 43 Appointment clone = (Appointment)base.Clone(cloner); 44 clone.AllDayEvent = this.AllDayEvent; 45 clone.EndDate = this.EndDate; 46 clone.Recurring = this.Recurring; 47 clone.RecurringId = this.RecurringId; 48 clone.ResourceId = this.ResourceId; 49 clone.StartDate = this.StartDate; 50 return clone; 51 return new Appointment(this, cloner); 51 52 } 52 53 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HiveExperiment.cs
r4649 r4796 25 25 26 26 namespace HeuristicLab.Services.Hive.Common.DataTransfer { 27 28 27 [DataContract] 29 28 [Serializable] … … 34 33 public Guid? RootJobId { get; set; } 35 34 35 public HiveExperiment() { } 36 protected HiveExperiment(HiveExperiment original, Cloner cloner) : base(original, cloner) { 37 this.RootJobId = original.RootJobId; 38 this.UserId = original.UserId; 39 } 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new HiveExperiment(this, cloner); 42 } 43 36 44 public override string ToString() { 37 45 return base.ToString() + "Name: " + Name + ", Description: " + Description; 38 46 } 39 40 public override IDeepCloneable Clone(Cloner cloner) {41 var clone = (HiveExperiment)base.Clone(cloner);42 clone.RootJobId = this.RootJobId;43 clone.UserId = this.UserId;44 return clone;45 }46 47 } 47 48 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HiveItem.cs
r4649 r4796 5 5 using System.Runtime.Serialization; 6 6 using HeuristicLab.Common; 7 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 8 8 9 namespace HeuristicLab.Services.Hive.Common.DataTransfer { … … 13 14 public Guid Id { get; set; } 14 15 15 public virtual IDeepCloneable Clone(Cloner cloner) { 16 HiveItem clone = (HiveItem)base.Clone(cloner); 17 clone.Id = this.Id; 18 return clone; 16 public HiveItem() { } 17 protected HiveItem(HiveItem original, Cloner cloner) : base(original, cloner) { 18 this.Id = original.Id; 19 19 } 20 20 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HiveItemBase.cs
r4649 r4796 5 5 using HeuristicLab.Common; 6 6 using System.Runtime.Serialization; 7 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 8 8 9 namespace HeuristicLab.Services.Hive.Common.DataTransfer { 9 10 [DataContract] 10 11 [Serializable] 11 public class HiveItemBase : IDeepCloneable { 12 public virtual IDeepCloneable Clone(Cloner cloner) { 13 HiveItem clone = (HiveItem)Activator.CreateInstance(this.GetType(), true); 14 cloner.RegisterClonedObject(this, clone); 15 return clone; 16 } 17 18 public object Clone() { 19 return Clone(new Cloner()); 20 } 12 public abstract class HiveItemBase : DeepCloneable { 13 protected HiveItemBase() { } 14 protected HiveItemBase(HiveItemBase original, Cloner cloner) : base(original, cloner) { } 21 15 } 22 16 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HivePlugin.cs
r4629 r4796 35 35 public bool Update { get; set; } 36 36 37 public HivePlugin() { } 38 protected HivePlugin(HivePlugin original, Cloner cloner) : base(original, cloner) { 39 this.Version = original.Version; 40 this.Update = original.Update; 41 } 37 42 public override IDeepCloneable Clone(Cloner cloner) { 38 var clone = (HivePlugin)base.Clone(cloner); 39 clone.Version = this.Version; 40 clone.Update = this.Update; 41 return clone; 43 return new HivePlugin(this, cloner); 42 44 } 43 45 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HivePluginData.cs
r4629 r4796 35 35 Name = name; 36 36 } 37 37 public HivePluginData() { } 38 protected HivePluginData(HivePluginData original, Cloner cloner) : base(original, cloner) { 39 if (original.Data != null) this.Data = new byte[original.Data.Length]; Array.Copy(original.Data, this.Data, original.Data.Length); 40 } 38 41 public override IDeepCloneable Clone(Cloner cloner) { 39 var clone = (HivePluginData)base.Clone(cloner); 40 if (this.Data != null) clone.Data = new byte[this.Data.Length]; Array.Copy(this.Data, clone.Data, this.Data.Length); 41 return clone; 42 return new HivePluginData(this, cloner); 42 43 } 43 44 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Job.cs
r4649 r4796 41 41 public Guid? ProjectId { get; set; } 42 42 43 public override string ToString() { 44 return base.ToString() + "State: " + JobState + ", [SlaveId : " + SlaveId + " ] , DateCreated: " + DateCreated + ", DateCalculated: " + DateCalculated + 45 "Priority: " + Priority + ", CoresNeeded: " + CoresNeeded; 43 public Job() { } 44 protected Job(Job original, Cloner cloner) : base(original, cloner) { 45 this.UserId = original.UserId; 46 this.Priority = original.Priority; 47 this.CoresNeeded = original.CoresNeeded; 48 this.MemoryNeeded = original.MemoryNeeded; 49 this.ProjectId = original.ProjectId; 50 } 51 public override IDeepCloneable Clone(Cloner cloner) { 52 return new Job(this, cloner); 46 53 } 47 54 48 public Job() { 49 } 50 51 public override IDeepCloneable Clone(Cloner cloner) { 52 var clone = (Job)base.Clone(cloner); 53 clone.UserId = this.UserId; 54 clone.Priority = this.Priority; 55 clone.CoresNeeded = this.CoresNeeded; 56 clone.MemoryNeeded = this.MemoryNeeded; 57 clone.ProjectId = this.ProjectId; 58 return clone; 55 public override string ToString() { 56 return string.Format("State: {0}, SlaveId: {1}, DateCreated: {2}, DateCalculated: {3}, CoresNeeded: {4}, MemoryNeeded: {5}", JobState, SlaveId, DateCreated, DateCalculated, CoresNeeded, MemoryNeeded); 59 57 } 60 58 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/JobData.cs
r4649 r4796 34 34 public byte[] Data { get; set; } 35 35 36 public JobData() { } 37 protected JobData(JobData original, Cloner cloner) : base(original, cloner) { 38 if (original.Data != null) this.Data = new byte[original.Data.Length]; Array.Copy(original.Data, this.Data, original.Data.Length); 39 } 36 40 public override IDeepCloneable Clone(Cloner cloner) { 37 var clone = (JobData)base.Clone(cloner); 38 if (this.Data != null) clone.Data = new byte[this.Data.Length]; Array.Copy(this.Data, clone.Data, this.Data.Length); 39 return clone; 41 return new JobData(this, cloner); 40 42 } 41 43 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/LightweightJob.cs
r4649 r4796 48 48 JobState = DataTransfer.JobState.Offline; 49 49 } 50 51 50 public LightweightJob(Job job) { 52 51 this.SlaveId = job.SlaveId; … … 59 58 this.ParentJobId = job.ParentJobId; 60 59 } 61 60 protected LightweightJob(LightweightJob original, Cloner cloner) : base(original, cloner) { 61 this.SlaveId = original.SlaveId; 62 this.JobState = original.JobState; 63 this.ExecutionTime = original.ExecutionTime; 64 this.Exception = original.Exception; 65 this.DateCreated = original.DateCreated; 66 this.DateCalculated = original.DateCalculated; 67 this.DateFinished = original.DateFinished; 68 this.ParentJobId = original.ParentJobId; 69 } 62 70 public override IDeepCloneable Clone(Cloner cloner) { 63 var clone = (LightweightJob)base.Clone(cloner); 64 clone.SlaveId = this.SlaveId; 65 clone.JobState = this.JobState; 66 clone.ExecutionTime = this.ExecutionTime; 67 clone.Exception = this.Exception; 68 clone.DateCreated = this.DateCreated; 69 clone.DateCalculated = this.DateCalculated; 70 clone.DateFinished = this.DateFinished; 71 clone.ParentJobId = this.ParentJobId; 72 return clone; 71 return new LightweightJob(this, cloner); 73 72 } 74 73 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/NamedHiveItem.cs
r4629 r4796 14 14 public string Description { get; set; } 15 15 16 public override IDeepCloneable Clone(Cloner cloner) { 17 var clone = (NamedHiveItem)base.Clone(cloner); 18 clone.Name = this.Name; 19 clone.Description = this.Description; 20 return clone; 16 protected NamedHiveItem() { } 17 protected NamedHiveItem(NamedHiveItem original, Cloner cloner) : base(original, cloner) { 18 this.Name = original.Name; 19 this.Description = original.Description; 21 20 } 22 21 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Project.cs
r4593 r4796 22 22 using System; 23 23 using System.Runtime.Serialization; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Services.Hive.Common.DataTransfer { … … 27 28 [Serializable] 28 29 public class Project : NamedHiveItem { 30 31 public Project() { } 32 protected Project(Project original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Project(this, cloner); 35 } 29 36 } 30 37 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Resource.cs
r4593 r4796 29 29 public class Resource : NamedHiveItem { 30 30 31 public Resource() { } 32 protected Resource(Resource original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Resource(this, cloner); 35 } 31 36 } 32 37 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Slave.cs
r4649 r4796 50 50 SlaveState = DataTransfer.SlaveState.Idle; 51 51 } 52 protected Slave(Slave original, Cloner cloner) : base(original, cloner) { 53 this.Cores = original.Cores; 54 this.FreeCores = original.FreeCores; 55 this.CpuSpeed = original.CpuSpeed; 56 this.Memory = original.Memory; 57 this.FreeMemory = original.FreeMemory; 58 this.SlaveState = original.SlaveState; 59 this.CalendarSyncState = original.CalendarSyncState; 60 this.SlaveConfigId = original.SlaveConfigId; 61 this.IsAllowedToCalculate = original.IsAllowedToCalculate; 62 } 63 public override IDeepCloneable Clone(Cloner cloner) { 64 return new Slave(this, cloner); 65 } 52 66 53 67 public override string ToString() { 54 return base.ToString() + ", NrOfCores: " + Cores + ", NrOfFreeCores " + FreeCores + ", State: " + SlaveState; 55 } 56 57 public override IDeepCloneable Clone(Cloner cloner) { 58 var clone = (Slave)base.Clone(cloner); 59 clone.Cores = this.Cores; 60 clone.FreeCores = this.FreeCores; 61 clone.CpuSpeed = this.CpuSpeed; 62 clone.Memory = this.Memory; 63 clone.FreeMemory = this.FreeMemory; 64 clone.SlaveState = this.SlaveState; 65 clone.CalendarSyncState = this.CalendarSyncState; 66 clone.SlaveConfigId = this.SlaveConfigId; 67 clone.IsAllowedToCalculate = this.IsAllowedToCalculate; 68 return clone; 68 return string.Format("Cores: {0}, FreeCores: {1}", Cores, FreeCores); 69 69 } 70 70 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/SlaveConfig.cs
r4629 r4796 33 33 public int? HeartBeatIntervall { get; set; } 34 34 35 public SlaveConfig() { } 36 protected SlaveConfig(SlaveConfig original, Cloner cloner) : base(original, cloner) { 37 this.UpDownTimeCalendar = original.UpDownTimeCalendar; 38 this.HeartBeatIntervall = original.HeartBeatIntervall; 39 } 35 40 public override IDeepCloneable Clone(Cloner cloner) { 36 var clone = (SlaveConfig)base.Clone(cloner); 37 clone.UpDownTimeCalendar = this.UpDownTimeCalendar; 38 clone.HeartBeatIntervall = this.HeartBeatIntervall; 39 return clone; 41 return new SlaveConfig(this, cloner); 40 42 } 41 43 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/SlaveGroup.cs
r4649 r4796 37 37 ChildResourcesIds = new List<Guid>(); 38 38 } 39 39 protected SlaveGroup(SlaveGroup original, Cloner cloner) : base(original, cloner) { 40 this.ChildResourcesIds = new List<Guid>(original.ChildResourcesIds); 41 this.ParentResourcesIds = new List<Guid>(original.ParentResourcesIds); 42 } 40 43 public override IDeepCloneable Clone(Cloner cloner) { 41 var clone = (SlaveGroup)base.Clone(cloner); 42 clone.ChildResourcesIds = new List<Guid>(this.ChildResourcesIds); 43 clone.ParentResourcesIds = new List<Guid>(this.ParentResourcesIds); 44 return clone; 44 return new SlaveGroup(this, cloner); 45 45 } 46 46 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/UpTimeStatistics.cs
r4629 r4796 34 34 public DateTime Logout { get; set; } 35 35 36 public UpTimeStatistics() { } 37 protected UpTimeStatistics(UpTimeStatistics original, Cloner cloner) : base(original, cloner) { 38 this.SlaveId = original.SlaveId; 39 this.Login = original.Login; 40 this.Logout = original.Logout; 41 } 36 42 public override IDeepCloneable Clone(Cloner cloner) { 37 var clone = (UpTimeStatistics)base.Clone(cloner); 38 clone.SlaveId = this.SlaveId; 39 clone.Login = this.Login; 40 clone.Logout = this.Logout; 41 return clone; 43 return new UpTimeStatistics(this, cloner); 42 44 } 43 45 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/MessageContainer.cs
r4629 r4796 31 31 [StorableClass] 32 32 [Serializable] 33 public class MessageContainer : IDeepCloneable {33 public class MessageContainer : DeepCloneable { 34 34 35 35 public enum MessageType { … … 60 60 public Guid JobId { get; set; } 61 61 62 protected MessageContainer() { } 62 63 public MessageContainer(MessageType message) { 63 64 Message = message; 64 65 JobId = Guid.Empty; 65 66 } 66 67 67 public MessageContainer(MessageType message, Guid jobId) { 68 68 Message = message; 69 69 JobId = jobId; 70 70 } 71 72 public virtual IDeepCloneable Clone(Cloner cloner) { 73 MessageContainer clone = (MessageContainer)Activator.CreateInstance(this.GetType(), true); 74 cloner.RegisterClonedObject(this, clone); 75 clone.Message = this.Message; 76 clone.JobId = this.JobId; 77 return clone; 71 protected MessageContainer(MessageContainer original, Cloner cloner) : base(original, cloner) { 72 this.Message = original.Message; 73 this.JobId = original.JobId; 78 74 } 79 80 public object Clone() { 81 return Clone(new Cloner()); 75 public override IDeepCloneable Clone(Cloner cloner) { 76 return new MessageContainer(this, cloner); 82 77 } 83 78 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
r4649 r4796 72 72 <DependentUpon>HiveDataContext.dbml</DependentUpon> 73 73 </Compile> 74 <Compile Include="Interfaces\IContextFactory.cs" />75 74 <Compile Include="Interfaces\IHiveDao.cs" /> 76 75 <Compile Include="Properties\AssemblyInfo.cs" /> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/TransactionManager.cs
r4649 r4796 10 10 public class TransactionManager { 11 11 public Disposable<TransactionScope> OpenTransaction() { 12 TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.I SOLATION_LEVEL_SCOPE});12 TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.IsolationLevelScope }); 13 13 var disposable = new Disposable<TransactionScope>(transaction); 14 14 disposable.Disposing += disposable_Disposing;
Note: See TracChangeset
for help on using the changeset viewer.