Changeset 5062
- Timestamp:
- 12/07/10 16:11:14 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 4 added
- 2 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources ¶
- Property svn:ignore
-
TabularUnified
old new 1 1 HeuristicLab.Hive-3.4.suo 2 TestResults
-
- Property svn:ignore
-
TabularUnified branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests-3.4/HeuristicLab.Clients.Hive.Slave.Tests-3.4.csproj ¶
r5056 r5062 297 297 <RequiredTargetFramework>3.5</RequiredTargetFramework> 298 298 </Reference> 299 <Reference Include="System.Drawing" /> 299 300 <Reference Include="WeifenLuo.WinFormsUI.Docking-2.3.1"> 300 301 <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\WeifenLuo.WinFormsUI.Docking-2.3.1.dll</HintPath> … … 307 308 </ItemGroup> 308 309 <ItemGroup> 309 <Compile Include="Mocks\HiveServiceMock.cs" /> 310 <Compile Include="Mocks\MockHiveService.cs" /> 311 <Compile Include="Mocks\MockJob.cs" /> 310 312 <Compile Include="PluginLoader.cs" /> 311 313 <Compile Include="Properties\AssemblyInfo.cs" /> 312 <Compile Include="Mocks\ ServiceLocatorMock.cs" />314 <Compile Include="Mocks\MockServiceLocator.cs" /> 313 315 <Compile Include="SlaveTest.cs" /> 314 316 </ItemGroup> -
TabularUnified branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests-3.4/SlaveTest.cs ¶
r5055 r5062 13 13 public static void MyClassInitialize(TestContext testContext) { 14 14 PluginLoader.pluginAssemblies.Any(); 15 ServiceLocator.Instance = new ServiceLocatorMock();15 ServiceLocator.Instance = new MockServiceLocator(); 16 16 } 17 17 -
TabularUnified branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/SlaveDummy.cs ¶
r5055 r5062 6 6 namespace HeuristicLab.Clients.Hive.Slave { 7 7 public class SlaveDummy { 8 8 9 public void SayHello() { 9 10 using (var service = ServiceLocator.Instance.GetService()) { -
TabularUnified branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HeuristicLab.Clients.Hive-3.4.csproj ¶
r5055 r5062 83 83 <Compile Include="Exceptions\JobResultPollingException.cs" /> 84 84 <Compile Include="Exceptions\OptimizerNotFoundException.cs" /> 85 <Compile Include=" HiveExperiment\PluginClient.cs" />85 <Compile Include="ExperimentManager\PluginClient.cs" /> 86 86 <Compile Include="IServiceLocator.cs" /> 87 87 <Compile Include="Jobs\OptimizerJob.cs" /> 88 88 <Compile Include="HeuristicLabClientsHivePlugin.cs" /> 89 <Compile Include=" HiveExperiment\HiveExperimentManagerClient.cs" />90 <Compile Include=" HiveExperiment\HiveJobClient.cs" />91 <Compile Include=" HiveExperiment\HiveExperimentClient.cs" />92 <Compile Include=" HiveExperiment\JobResultPoller.cs" />89 <Compile Include="ExperimentManager\HiveExperimentManagerClient.cs" /> 90 <Compile Include="ExperimentManager\HiveJobClient.cs" /> 91 <Compile Include="ExperimentManager\HiveExperimentClient.cs" /> 92 <Compile Include="ExperimentManager\JobResultPoller.cs" /> 93 93 <Compile Include="Progress\IProgress.cs" /> 94 94 <Compile Include="Progress\IProgressReporter.cs" /> -
TabularUnified branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/Jobs/OptimizerJob.cs ¶
r4796 r5062 32 32 [StorableClass] 33 33 public class OptimizerJob : DeepCloneable, IJob { 34 public virtual bool IsParallelizable { 35 get { return this.Optimizer is Optimization.Experiment || this.Optimizer is BatchRun; } 36 } 37 34 38 [Storable] 35 39 protected IOptimizer optimizer; … … 81 85 this.log = new Log(); 82 86 } 83 public OptimizerJob(IOptimizer optimizer) 84 : this() { 87 public OptimizerJob(IOptimizer optimizer) : this() { 85 88 this.Optimizer = optimizer; 86 89 … … 95 98 [StorableConstructor] 96 99 protected OptimizerJob(bool deserializing) { } 97 protected OptimizerJob(OptimizerJob original, Cloner cloner) 98 : base(original, cloner) { 100 protected OptimizerJob(OptimizerJob original, Cloner cloner) : base(original, cloner) { 99 101 this.Optimizer = cloner.Clone(original.Optimizer); 100 102 this.log = cloner.Clone(original.Log); … … 135 137 public TimeSpan ExecutionTime { 136 138 get { return optimizer.ExecutionTime; } 137 }138 139 public virtual void Run() {140 throw new NotSupportedException();141 139 } 142 140 … … 152 150 optimizer.Start(); 153 151 } 152 } 153 154 public void Pause() { 155 throw new NotImplementedException(); 154 156 } 155 157 … … 301 303 if (handler != null) handler(this, new CancelEventArgs<string>(value, cancel)); 302 304 } 305 public event EventHandler ExecutionTimeChanged; 306 protected virtual void OnExecutionTimeChanged() { 307 EventHandler handler = ExecutionTimeChanged; 308 if (handler != null) handler(this, EventArgs.Empty); 309 } 310 public event EventHandler ExecutionStateChanged; 311 protected virtual void OnExecutionStateChanged() { 312 EventHandler handler = ExecutionStateChanged; 313 if (handler != null) handler(this, EventArgs.Empty); 314 } 303 315 #endregion 304 316 … … 330 342 return Name; 331 343 } 332 333 public virtual bool IsParallelizable {334 get { return this.Optimizer is Optimization.Experiment || this.Optimizer is BatchRun; }335 }336 337 344 } 338 345 } -
TabularUnified branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Hive-3.4.sln ¶
r5053 r5062 52 52 EndProjectSection 53 53 EndProject 54 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Clients.Hive.Slave.Tests-3.4", "HeuristicLab.Clients.Hive.Slave.Tests -3.4\HeuristicLab.Clients.Hive.Slave.Tests-3.4.csproj", "{C4CBD11E-1B83-464A-B0AD-0DC0FF7E57AA}"54 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Clients.Hive.Slave.Tests-3.4", "HeuristicLab.Clients.Hive.Slave.Tests\HeuristicLab.Clients.Hive.Slave.Tests-3.4.csproj", "{C4CBD11E-1B83-464A-B0AD-0DC0FF7E57AA}" 55 55 EndProject 56 56 Global -
TabularUnified branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Hive/3.4/IJob.cs ¶
r4593 r5062 27 27 namespace HeuristicLab.Hive { 28 28 public interface IJob : INamedItem { 29 29 30 TimeSpan ExecutionTime { get; } 30 31 … … 41 42 /// </summary> 42 43 bool ComputeInParallel { get; set; } 44 45 /// <summary> 46 /// If this is set to true, the job should be Resumed with the child-jobs attatched instead of Started 47 /// </summary> 48 bool CollectChildJobs { get; set; } 49 50 void Prepare(); 51 52 void Start(); 53 54 void Pause(); 55 56 void Stop(); 57 58 void Resume(IEnumerable<IJob> childJobs); 59 43 60 event EventHandler ComputeInParallelChanged; 44 61 45 void Run(); 46 void Prepare(); 47 void Start(); 48 void Stop(); 49 void Resume(IEnumerable<IJob> childJobs); 62 event EventHandler ExecutionTimeChanged; 50 63 51 event EventHandler JobStopped; 52 event EventHandler JobFailed; 53 64 event EventHandler ExecutionStateChanged; 65 54 66 /// <summary> 55 67 /// When this event occurs the job wants to sleep until all his child jobs are finished … … 67 79 event EventHandler DeleteChildJobs; 68 80 69 /// <summary> 70 /// If this is set to true, the job should be Resumed with the child-jobs attatched instead of Started 71 /// </summary> 72 bool CollectChildJobs { get; set; } 81 73 82 } 74 83 } -
TabularUnified branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs ¶
r5053 r5062 35 35 JobData GetJobData(Guid jobId); 36 36 37 //[OperationContract]38 //Stream GetJobDataStreamed(Guid jobId);39 40 37 [OperationContract] 41 38 void UpdateJob(Job jobDto, JobData jobDataDto); 42 43 //[OperationContract] // formerly StoreFinishedJobResultStreamed44 //void UpdateJobDataStreamed(Stream stream);45 39 46 40 [OperationContract] … … 49 43 [OperationContract] // new method: appropriate job is choosen and set to 'calculating'. the slave is responsible for requesting the jobData. Server should wait some timeout until he redistributes the job 50 44 Job AquireJob(Guid slaveId); 51 52 //[OperationContract] // dump?53 //Job GetJobByIdWithDetails(Guid jobId);54 55 //[OperationContract] dump?56 //Job AddNewJob(JobData job);57 58 //[OperationContract]59 //void RemoveJob(Guid jobId);60 61 //[OperationContract] // GetJobForCalculation (was this used?62 //Job GetJob(Guid slaveId);63 64 //[OperationContract] --> replaced by UpdateJob65 //void StoreFinishedJobResult(Guid slaveId, Guid jobId, byte[] result, TimeSpan executionTime, string exception);66 67 //[OperationContract] dump this! a slave should just check if job is still offline, if so it can submit the finished job, otherwise throw away! its a rare case that a slave reawakes with a finished job68 //void IsJobStillNeeded(Guid jobId);69 70 //[OperationContract] // dump?71 //Job AddJobWithGroupStrings(JobData jobObj, IEnumerable<string> groups);72 45 #endregion 73 46 … … 77 50 78 51 [OperationContract] 79 JobPauseJob(Guid jobId);52 void PauseJob(Guid jobId); 80 53 #endregion 81 54 … … 101 74 102 75 #region Login Methods 103 // rename "Login"-methods to "Register" or "SayHello", since its only purpose is to send Slave-Info (is Login() should not be used anymore)104 /// <summary>105 /// Method can be used to check if security credentials are valid, but it does not do anything106 /// </summary>107 /// <returns></returns>108 //[OperationContract]109 //void Login();110 ///// <summary>111 ///// This method registers the slave and marks it as online112 ///// </summary>113 //[OperationContract]114 //void Login(Slave slave);115 //[OperationContract]116 //void Logout(Guid clientId);117 118 76 [OperationContract] 119 77 void Hello(Guid slaveId, string name, int cores, int memory); … … 136 94 IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds); 137 95 #endregion 138 139 // slave should be unaware of calendar. only server decides based on calendar if slave gets jobs 140 //#region Calendar Methods 141 //[OperationContract] 142 //IEnumerable<Appointment> GetCalendar(Guid slaveId); 143 //[OperationContract] 144 //void SetCalendarStatus(Guid clientId, CalendarState state); 145 //[OperationContract] 146 //IEnumerable<Appointment> GetUptimeCalendarForResource(Guid guid); 147 //[OperationContract] 148 //void SetUptimeCalendarForResource(Guid guid, IEnumerable<Appointment> appointments, bool isForced); 149 //#endregion 150 96 151 97 #region Slave Methods 152 98 [OperationContract] … … 160 106 161 107 [OperationContract] 162 //[ServiceKnownType(typeof(Resource))] - not sure about those163 //[ServiceKnownType(typeof(Slave))]164 //[ServiceKnownType(typeof(SlaveGroup))]108 [ServiceKnownType(typeof(Resource))] 109 [ServiceKnownType(typeof(Slave))] 110 [ServiceKnownType(typeof(SlaveGroup))] 165 111 IEnumerable<SlaveGroup> GetSlaveGroups(); 166 112 … … 169 115 170 116 [OperationContract] 171 //[ServiceKnownType(typeof(Resource))]172 //[ServiceKnownType(typeof(Slave))]173 //[ServiceKnownType(typeof(SlaveGroup))]117 [ServiceKnownType(typeof(Resource))] 118 [ServiceKnownType(typeof(Slave))] 119 [ServiceKnownType(typeof(SlaveGroup))] 174 120 void AddResourceToGroup(Guid slaveGroupId, Resource resource); 175 121 -
TabularUnified branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs ¶
r5055 r5062 119 119 } 120 120 } 121 public JobPauseJob(Guid jobId) {121 public void PauseJob(Guid jobId) { 122 122 using (trans.OpenTransaction()) { 123 123 throw new NotImplementedException();
Note: See TracChangeset
for help on using the changeset viewer.