Changeset 4905 for branches/HeuristicLab.Hive/sources
- Timestamp:
- 11/22/10 17:13:27 (14 years ago)
- Location:
- branches/HeuristicLab.Hive/sources
- Files:
-
- 38 added
- 3 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New
- Property svn:ignore
-
old new 1 1 *.suo 2 Tests
-
- Property svn:ignore
-
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive.Slave.Views/3.3/HeuristicLab.Clients.Hive.Slave.Views-3.3.csproj
r4629 r4905 9 9 <OutputType>Library</OutputType> 10 10 <AppDesignerFolder>Properties</AppDesignerFolder> 11 <RootNamespace>HeuristicLab.Clients.Hive.Slave.Views .Application</RootNamespace>12 <AssemblyName>HeuristicLab.Clients.Hive.Slave.Views .Application</AssemblyName>11 <RootNamespace>HeuristicLab.Clients.Hive.Slave.Views</RootNamespace> 12 <AssemblyName>HeuristicLab.Clients.Hive.Slave.Views-3.3</AssemblyName> 13 13 <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> 14 14 <FileAlignment>512</FileAlignment> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive.Views/3.3/HeuristicLab.Clients.Hive.Views-3.3.csproj
r4629 r4905 38 38 </PropertyGroup> 39 39 <ItemGroup> 40 <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 41 <SpecificVersion>False</SpecificVersion> 42 </Reference> 40 43 <Reference Include="HeuristicLab.Common-3.3"> 41 44 <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath> 42 45 </Reference> 46 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 47 <SpecificVersion>False</SpecificVersion> 48 </Reference> 43 49 <Reference Include="HeuristicLab.Core-3.3"> 44 50 <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath> 51 </Reference> 52 <Reference Include="HeuristicLab.Core.Views-3.3"> 53 <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Core.Views-3.3.dll</HintPath> 54 </Reference> 55 <Reference Include="HeuristicLab.Data-3.3"> 56 <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath> 57 </Reference> 58 <Reference Include="HeuristicLab.MainForm-3.3"> 59 <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm-3.3.dll</HintPath> 60 </Reference> 61 <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3"> 62 <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath> 63 </Reference> 64 <Reference Include="HeuristicLab.Optimization-3.3"> 65 <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath> 66 </Reference> 67 <Reference Include="HeuristicLab.Optimizer-3.3"> 68 <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Optimizer-3.3.dll</HintPath> 45 69 </Reference> 46 70 <Reference Include="HeuristicLab.Persistence-3.3"> … … 52 76 <Reference Include="System" /> 53 77 <Reference Include="System.Core" /> 78 <Reference Include="System.Drawing" /> 79 <Reference Include="System.Windows.Forms" /> 54 80 <Reference Include="System.Xml.Linq" /> 55 81 <Reference Include="System.Data.DataSetExtensions" /> … … 58 84 </ItemGroup> 59 85 <ItemGroup> 86 <Compile Include="ExperimentManager\ConnectionSetupView.cs"> 87 <SubType>Form</SubType> 88 </Compile> 89 <Compile Include="ExperimentManager\ConnectionSetupView.Designer.cs"> 90 <DependentUpon>ConnectionSetupView.cs</DependentUpon> 91 </Compile> 92 <Compile Include="ExperimentManager\HiveExperimentListView.cs"> 93 <SubType>UserControl</SubType> 94 </Compile> 95 <Compile Include="ExperimentManager\HiveExperimentListView.Designer.cs"> 96 <DependentUpon>HiveExperimentListView.cs</DependentUpon> 97 </Compile> 98 <Compile Include="ExperimentManager\HiveExperimentManagerView.cs"> 99 <SubType>UserControl</SubType> 100 </Compile> 101 <Compile Include="ExperimentManager\HiveExperimentManagerView.Designer.cs"> 102 <DependentUpon>HiveExperimentManagerView.cs</DependentUpon> 103 </Compile> 104 <Compile Include="ExperimentManager\HiveExperimentView.cs"> 105 <SubType>UserControl</SubType> 106 </Compile> 107 <Compile Include="ExperimentManager\HiveExperimentView.Designer.cs"> 108 <DependentUpon>HiveExperimentView.cs</DependentUpon> 109 </Compile> 110 <Compile Include="ExperimentManager\HiveJobListView.cs"> 111 <SubType>UserControl</SubType> 112 </Compile> 113 <Compile Include="ExperimentManager\HiveJobListView.designer.cs"> 114 <DependentUpon>HiveJobListView.cs</DependentUpon> 115 </Compile> 116 <Compile Include="ExperimentManager\HiveJobView.cs"> 117 <SubType>UserControl</SubType> 118 </Compile> 119 <Compile Include="ExperimentManager\HiveJobView.designer.cs"> 120 <DependentUpon>HiveJobView.cs</DependentUpon> 121 </Compile> 122 <Compile Include="ExperimentManager\MenuItems\ConnectionSetupMenuItem.cs" /> 123 <Compile Include="ExperimentManager\MenuItems\ExperimentManagerMenuItem.cs" /> 60 124 <Compile Include="HeuristicLabClientsHiveViewsPlugin.cs" /> 125 <Compile Include="Progress\ProgressView.cs"> 126 <SubType>UserControl</SubType> 127 </Compile> 128 <Compile Include="Progress\ProgressView.designer.cs"> 129 <DependentUpon>ProgressView.cs</DependentUpon> 130 </Compile> 61 131 <Compile Include="Properties\AssemblyInfo.cs" /> 62 132 </ItemGroup> 63 133 <ItemGroup> 64 134 <None Include="HeuristicLab.snk" /> 135 </ItemGroup> 136 <ItemGroup> 137 <EmbeddedResource Include="ExperimentManager\ConnectionSetupView.resx"> 138 <DependentUpon>ConnectionSetupView.cs</DependentUpon> 139 </EmbeddedResource> 140 <EmbeddedResource Include="ExperimentManager\HiveExperimentManagerView.resx"> 141 <DependentUpon>HiveExperimentManagerView.cs</DependentUpon> 142 </EmbeddedResource> 143 <EmbeddedResource Include="ExperimentManager\HiveExperimentView.resx"> 144 <DependentUpon>HiveExperimentView.cs</DependentUpon> 145 </EmbeddedResource> 146 <EmbeddedResource Include="ExperimentManager\HiveJobView.resx"> 147 <DependentUpon>HiveJobView.cs</DependentUpon> 148 </EmbeddedResource> 149 <EmbeddedResource Include="Progress\ProgressView.resx"> 150 <DependentUpon>ProgressView.cs</DependentUpon> 151 </EmbeddedResource> 152 </ItemGroup> 153 <ItemGroup> 154 <ProjectReference Include="..\..\HeuristicLab.Clients.Hive\3.3\HeuristicLab.Clients.Hive-3.3.csproj"> 155 <Project>{B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}</Project> 156 <Name>HeuristicLab.Clients.Hive-3.3</Name> 157 </ProjectReference> 158 <ProjectReference Include="..\..\HeuristicLab.Hive\3.3\HeuristicLab.Hive-3.3.csproj"> 159 <Project>{F98A1740-9AC9-4D36-A582-6A2D0D06978D}</Project> 160 <Name>HeuristicLab.Hive-3.3</Name> 161 </ProjectReference> 162 <ProjectReference Include="..\..\HeuristicLab.Services.Hive.Common\3.3\HeuristicLab.Services.Hive.Common-3.3.csproj"> 163 <Project>{14424A16-48D4-445E-80BF-DDF617548BBB}</Project> 164 <Name>HeuristicLab.Services.Hive.Common-3.3</Name> 165 </ProjectReference> 65 166 </ItemGroup> 66 167 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/HeuristicLab.Clients.Hive-3.3.csproj
r4796 r4905 45 45 <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath> 46 46 </Reference> 47 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.2.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 47 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 48 <SpecificVersion>False</SpecificVersion> 49 <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common.Resources-3.3.dll</HintPath> 50 </Reference> 48 51 <Reference Include="HeuristicLab.Core-3.3"> 49 52 <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath> … … 61 64 <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 62 65 </Reference> 63 <Reference Include="HeuristicLab.Tracing-3.3, Version=3.2.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 66 <Reference Include="HeuristicLab.Tracing-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 67 <SpecificVersion>False</SpecificVersion> 68 <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Tracing-3.3.dll</HintPath> 69 </Reference> 64 70 <Reference Include="System" /> 65 71 <Reference Include="System.Core" /> … … 76 82 <Compile Include="Exceptions\JobResultPollingException.cs" /> 77 83 <Compile Include="Exceptions\OptimizerNotFoundException.cs" /> 84 <Compile Include="HiveExperiment\PluginClient.cs" /> 78 85 <Compile Include="Jobs\OptimizerJob.cs" /> 79 86 <Compile Include="HeuristicLabClientsHivePlugin.cs" /> 80 <Compile Include="HiveExperiment\Hive Client.cs" />87 <Compile Include="HiveExperiment\HiveExperimentManagerClient.cs" /> 81 88 <Compile Include="HiveExperiment\HiveJobClient.cs" /> 82 89 <Compile Include="HiveExperiment\HiveExperimentClient.cs" /> … … 99 106 <None Include="ServiceClients\GenerateServiceClients.cmd" /> 100 107 <None Include="Properties\Settings.settings"> 101 <Generator> SettingsSingleFileGenerator</Generator>108 <Generator>PublicSettingsSingleFileGenerator</Generator> 102 109 <LastGenOutput>Settings.Designer.cs</LastGenOutput> 103 110 </None> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/HiveExperiment/HiveExperimentClient.cs
r4796 r4905 44 44 private const string itemDescription = "A runner for a single experiment, which's algorithms are executed in the Hive."; 45 45 private System.Timers.Timer timer; 46 private DateTime lastUpdateTime; 47 private Guid? rootJobId; 48 private JobResultPoller jobResultPoller; 46 49 47 50 private Guid hiveExperimentId; … … 69 72 } 70 73 71 private DateTime lastUpdateTime;72 73 74 private string resourceIds; 74 75 public string ResourceIds { … … 82 83 } 83 84 84 private Guid? rootJobId;85 86 85 private bool isPollingResults; 87 86 public bool IsPollingResults { … … 111 110 } 112 111 113 private JobResultPoller jobResultPoller; 114 115 116 public HiveExperimentClient() 117 : base(itemName, itemDescription) { 118 //this.ResourceIds = HeuristicLab.Hive.Experiment.Properties.Settings.Default.ResourceIds; 112 public HiveExperimentClient() : base(itemName, itemDescription) { 113 // TODO //this.ResourceIds = HeuristicLab.Hive.Experiment.Properties.Settings.Default.ResourceIds; 119 114 this.ResourceIds = "MyGroup"; 120 115 this.log = new Log(); 121 116 InitTimer(); 122 117 } 123 public HiveExperimentClient(DT.HiveExperiment hiveExperimentDto) 124 : this() { 118 public HiveExperimentClient(DT.HiveExperiment hiveExperimentDto) : this() { 125 119 UpdateFromDto(hiveExperimentDto); 126 120 } 127 121 protected HiveExperimentClient(HiveExperimentClient original, Cloner cloner) 128 122 : base(original, cloner) { 129 this. resourceIds = original.resourceIds;130 this. executionState = original.executionState;131 this. executionTime = original.executionTime;123 this.ResourceIds = original.resourceIds; 124 this.ExecutionState = original.executionState; 125 this.ExecutionTime = original.executionTime; 132 126 this.log = cloner.Clone(original.log); 133 127 this.lastUpdateTime = original.lastUpdateTime; … … 137 131 return new HiveExperimentClient(this, cloner); 138 132 } 139 140 133 141 134 public void UpdateFromDto(DT.HiveExperiment hiveExperimentDto) { … … 143 136 this.Name = hiveExperimentDto.Name; 144 137 this.Description = hiveExperimentDto.Description; 145 // this.ResourceIds = hiveExperimentDto.ResourceIds;138 // TODO: this.ResourceIds = hiveExperimentDto.ResourceIds; 146 139 this.rootJobId = hiveExperimentDto.RootJobId; 147 140 } … … 270 263 jobCount++; 271 264 this.progress.Status = string.Format("Serializing job {0} of {1}", jobCount, totalJobCount); 272 JobData serializedJob;265 JobData jobData; 273 266 if (hiveJob.OptimizerJob.ComputeInParallel && 274 267 (hiveJob.OptimizerJob.Optimizer is Optimization.Experiment || hiveJob.OptimizerJob.Optimizer is Optimization.BatchRun)) { 275 268 hiveJob.Job.JobState = JobState.WaitingForChildJobs; 276 269 hiveJob.OptimizerJob.CollectChildJobs = false; // don't collect child-jobs on slaves 277 serializedJob = hiveJob.GetAsSerializedJob(true);270 jobData = hiveJob.GetAsJobData(true); 278 271 } else { 279 serializedJob = hiveJob.GetAsSerializedJob(false);280 } 281 282 this.progress.Status = string.Format("Uploading job {0} of {1} ({2} kb)", jobCount, totalJobCount, serializedJob.Data.Count() / 1024);272 jobData = hiveJob.GetAsJobData(false); 273 } 274 275 this.progress.Status = string.Format("Uploading job {0} of {1} ({2} kb)", jobCount, totalJobCount, jobData.Data.Count() / 1024); 283 276 this.progress.ProgressValue = (double)jobCount / totalJobCount; 284 277 285 278 if (parentHiveJob != null) { 286 279 //response = service.AddChildJob(parentHiveJob.Job.Id, serializedJob); 287 hiveJob.Job.Id = service.AddChildJob(parentHiveJob.Job.Id, hiveJob.Job, serializedJob);280 hiveJob.Job.Id = service.AddChildJob(parentHiveJob.Job.Id, hiveJob.Job, jobData); 288 281 } else { 289 282 // response = service.AddJobWithGroupStrings(serializedJob, groups); 290 hiveJob.Job.Id = service.AddJob(hiveJob.Job, serializedJob);283 hiveJob.Job.Id = service.AddJob(hiveJob.Job, jobData); 291 284 } 292 285 … … 467 460 LogMessage(hj.Job.Id, "Downloading optimizer for job"); 468 461 OptimizerJob optimizerJob = LoadOptimizerJob(hj.Job.Id); 469 if ( lightweightJob.ParentJobId.HasValue) {470 HiveJob parentHiveJob = HiveJob.GetHiveJobByJobId(lightweightJob.ParentJobId.Value);471 parentHiveJob.UpdateChildOptimizer(optimizerJob, hj.Job.Id);462 if (optimizerJob == null) { 463 // something bad happened to this job. set to finished to allow the rest beeing downloaded 464 hj.IsFinishedOptimizerDownloaded = true; 472 465 } else { 473 this.HiveJob.IsFinishedOptimizerDownloaded = true; 466 if (lightweightJob.ParentJobId.HasValue) { 467 HiveJob parentHiveJob = HiveJob.GetHiveJobByJobId(lightweightJob.ParentJobId.Value); 468 parentHiveJob.UpdateChildOptimizer(optimizerJob, hj.Job.Id); 469 } else { 470 this.HiveJob.IsFinishedOptimizerDownloaded = true; 471 } 474 472 } 475 473 } … … 541 539 // download them first 542 540 IDictionary<Guid, Job> allJobs = new Dictionary<Guid, Job>(); 543 IDictionary<Guid, JobData> all SerializedJobs = new Dictionary<Guid, JobData>();541 IDictionary<Guid, JobData> allJobDatas = new Dictionary<Guid, JobData>(); 544 542 foreach (LightweightJob lightweightJob in allResults) { 545 543 jobCount++; 546 544 progress.Status = string.Format("Downloading {0} of {1} jobs...", jobCount, totalJobCount); 547 545 allJobs.Add(lightweightJob.Id, service.Obj.GetJob(lightweightJob.Id)); 548 all SerializedJobs.Add(lightweightJob.Id, service.Obj.GetJobData(lightweightJob.Id));546 allJobDatas.Add(lightweightJob.Id, service.Obj.GetJobData(lightweightJob.Id)); 549 547 progress.ProgressValue = (double)jobCount / totalJobCount; 550 548 } 551 549 552 550 jobCount = 1; 553 progress.Status = string.Format("Deserializing {0} of {1} jobs... ({2} kb)", jobCount, totalJobCount, all SerializedJobs[this.rootJobId.Value].Data.Count() / 1024);554 this.HiveJob = new HiveJob(allJobs[this.rootJobId.Value], all SerializedJobs[this.rootJobId.Value], false);555 all SerializedJobs.Remove(this.rootJobId.Value); // reduce memory footprint551 progress.Status = string.Format("Deserializing {0} of {1} jobs... ({2} kb)", jobCount, totalJobCount, allJobDatas[this.rootJobId.Value].Data.Count() / 1024); 552 this.HiveJob = new HiveJob(allJobs[this.rootJobId.Value], allJobDatas[this.rootJobId.Value], false); 553 allJobDatas.Remove(this.rootJobId.Value); // reduce memory footprint 556 554 allJobs.Remove(this.rootJobId.Value); 557 555 progress.ProgressValue = (double)jobCount / totalJobCount; … … 570 568 571 569 // build child-job tree 572 LoadChildResults(service.Obj, this.HiveJob, allResults, allJobs, all SerializedJobs, progress, totalJobCount, ref jobCount);570 LoadChildResults(service.Obj, this.HiveJob, allResults, allJobs, allJobDatas, progress, totalJobCount, ref jobCount); 573 571 StartResultPolling(); 574 572 } … … 582 580 } 583 581 584 private void LoadChildResults(IHiveService service, HiveJob parentHiveJob, IEnumerable<LightweightJob> allResults, IDictionary<Guid, Job> allJobs, IDictionary<Guid, JobData> all SerializedJobs, IProgress progress, int totalJobCount, ref int jobCount) {582 private void LoadChildResults(IHiveService service, HiveJob parentHiveJob, IEnumerable<LightweightJob> allResults, IDictionary<Guid, Job> allJobs, IDictionary<Guid, JobData> allJobDatas, IProgress progress, int totalJobCount, ref int jobCount) { 585 583 IEnumerable<LightweightJob> childResults = from result in allResults 586 584 where result.ParentJobId.HasValue && result.ParentJobId.Value == parentHiveJob.Job.Id … … 589 587 foreach (LightweightJob lightweightJob in childResults) { 590 588 jobCount++; 591 progress.Status = string.Format("Deserializing {0} of {1} jobs ({2} kb)...", jobCount, totalJobCount, allSerializedJobs[lightweightJob.Id].Data.Count() / 1024); 592 OptimizerJob optimizerJob = PersistenceUtil.Deserialize<OptimizerJob>(allSerializedJobs[lightweightJob.Id].Data); 589 progress.Status = string.Format("Deserializing {0} of {1} jobs ({2} kb)...", jobCount, totalJobCount, allJobDatas[lightweightJob.Id].Data.Count() / 1024); 590 OptimizerJob optimizerJob = null; 591 try { 592 optimizerJob = PersistenceUtil.Deserialize<OptimizerJob>(allJobDatas[lightweightJob.Id].Data); 593 } 594 catch { 595 optimizerJob = null; 596 } 593 597 progress.ProgressValue = (double)jobCount / totalJobCount; 594 598 HiveJob childHiveJob = new HiveJob(optimizerJob, false); 595 599 parentHiveJob.AddChildHiveJob(childHiveJob); 596 600 childHiveJob.Job = allJobs[lightweightJob.Id]; 597 all SerializedJobs.Remove(lightweightJob.Id); // reduce memory footprint601 allJobDatas.Remove(lightweightJob.Id); // reduce memory footprint 598 602 allJobs.Remove(lightweightJob.Id); 599 603 if (jobCount % 10 == 0) GC.Collect(); // this is needed or otherwise HL takes over the system when the number of jobs is high 600 LoadChildResults(service, childHiveJob, allResults, allJobs, all SerializedJobs, progress, totalJobCount, ref jobCount);604 LoadChildResults(service, childHiveJob, allResults, allJobs, allJobDatas, progress, totalJobCount, ref jobCount); 601 605 } 602 606 } … … 604 608 private OptimizerJob LoadOptimizerJob(Guid jobId) { 605 609 using (var service = ServiceLocator.Instance.ServicePool.GetService()) { 606 JobData serializedJob = service.Obj.GetJobData(jobId); 607 return PersistenceUtil.Deserialize<OptimizerJob>(serializedJob.Data); 610 JobData jobData = service.Obj.GetJobData(jobId); 611 try { 612 return PersistenceUtil.Deserialize<OptimizerJob>(jobData.Data); 613 } 614 catch { 615 return null; 616 } 608 617 } 609 618 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/HiveExperiment/HiveJobClient.cs
r4796 r4905 31 31 using HeuristicLab.Services.Hive.Common.DataTransfer; 32 32 using HeuristicLab.Clients.Hive.Jobs; 33 using HeuristicLab.PluginInfrastructure; 34 using System.IO; 35 using HeuristicLab.PluginInfrastructure.Manager; 33 36 34 37 namespace HeuristicLab.Clients.Hive { 35 38 39 [Item("Hive Job", "Represents a hive job.")] 36 40 public class HiveJob : Item { 37 41 private static object locker = new object(); … … 136 140 } 137 141 138 public HiveJob(Job job, JobData serializedJob, bool autoCreateChildHiveJobs)142 public HiveJob(Job job, JobData jobData, bool autoCreateChildHiveJobs) 139 143 : this() { 140 144 this.syncJobsWithOptimizers = autoCreateChildHiveJobs; 141 145 this.Job = job; 142 this.OptimizerJob = PersistenceUtil.Deserialize<OptimizerJob>(serializedJob.Data); 146 try { 147 this.OptimizerJob = PersistenceUtil.Deserialize<OptimizerJob>(jobData.Data); 148 } 149 catch { 150 this.OptimizerJob = null; 151 } 143 152 this.syncJobsWithOptimizers = true; 144 153 } … … 193 202 batchRun.AlgorithmChanged += new EventHandler(batchRun_AlgorithmChanged); 194 203 } 195 196 204 OptimizerJob.ComputeInParallelChanged += new EventHandler(OptimizerJob_ComputeInParallelChanged); 197 205 OptimizerJob.ToStringChanged += new EventHandler(OptimizerJob_ToStringChanged); … … 199 207 } 200 208 private void DergisterOptimizerEvents() { 201 if ( Job != null && OptimizerJob.Optimizer is Optimization.Experiment) {209 if (OptimizerJob != null) { 202 210 if (OptimizerJob.Optimizer is Optimization.Experiment) { 203 211 Optimization.Experiment experiment = OptimizerJob.OptimizerAsExperiment; … … 211 219 batchRun.AlgorithmChanged -= new EventHandler(batchRun_AlgorithmChanged); 212 220 } 213 214 221 OptimizerJob.ComputeInParallelChanged -= new EventHandler(OptimizerJob_ComputeInParallelChanged); 215 222 OptimizerJob.ToStringChanged -= new EventHandler(OptimizerJob_ToStringChanged); … … 285 292 this.childHiveJobs.Add(hiveJob); 286 293 syncJobsWithOptimizers = false; 287 if (this.OptimizerJob.Optimizer is Optimization.Experiment) { 288 if (!this.OptimizerJob.OptimizerAsExperiment.Optimizers.Contains(hiveJob.OptimizerJob.Optimizer)) { 289 UpdateOptimizerInExperiment(this.OptimizerJob.OptimizerAsExperiment, hiveJob.OptimizerJob); 290 } 291 } else if (this.OptimizerJob.Optimizer is Optimization.BatchRun) { 292 UpdateOptimizerInBatchRun(this.OptimizerJob.OptimizerAsBatchRun, hiveJob.OptimizerJob); 294 if (this.OptimizerJob != null && hiveJob.OptimizerJob != null) { 295 if (this.OptimizerJob.Optimizer is Optimization.Experiment) { 296 if (!this.OptimizerJob.OptimizerAsExperiment.Optimizers.Contains(hiveJob.OptimizerJob.Optimizer)) { 297 UpdateOptimizerInExperiment(this.OptimizerJob.OptimizerAsExperiment, hiveJob.OptimizerJob); 298 } 299 } else if (this.OptimizerJob.Optimizer is Optimization.BatchRun) { 300 UpdateOptimizerInBatchRun(this.OptimizerJob.OptimizerAsBatchRun, hiveJob.OptimizerJob); 301 } 293 302 } 294 303 syncJobsWithOptimizers = true; … … 305 314 bool childIsFinishedOptimizerDownloaded = false; 306 315 307 if (this.OptimizerJob.Optimizer is Optimization.Experiment) { 308 UpdateOptimizerInExperiment(this.OptimizerJob.OptimizerAsExperiment, optimizerJob); 309 childIsFinishedOptimizerDownloaded = true; 310 } else if (this.OptimizerJob.Optimizer is Optimization.BatchRun) { 311 UpdateOptimizerInBatchRun(this.OptimizerJob.OptimizerAsBatchRun, optimizerJob); 312 if (this.OptimizerJob.OptimizerAsBatchRun.Repetitions == this.OptimizerJob.Optimizer.Runs.Count) { 316 if (this.OptimizerJob != null && this.OptimizerJob.Optimizer != null) { 317 if (this.OptimizerJob.Optimizer is Optimization.Experiment) { 318 UpdateOptimizerInExperiment(this.OptimizerJob.OptimizerAsExperiment, optimizerJob); 313 319 childIsFinishedOptimizerDownloaded = true; 314 } 315 } else { 316 childIsFinishedOptimizerDownloaded = optimizerJob.Optimizer.ExecutionState == ExecutionState.Stopped; 320 } else if (this.OptimizerJob.Optimizer is Optimization.BatchRun) { 321 UpdateOptimizerInBatchRun(this.OptimizerJob.OptimizerAsBatchRun, optimizerJob); 322 if (this.OptimizerJob.OptimizerAsBatchRun.Repetitions == this.OptimizerJob.Optimizer.Runs.Count) { 323 childIsFinishedOptimizerDownloaded = true; 324 } 325 } else { 326 childIsFinishedOptimizerDownloaded = optimizerJob.Optimizer.ExecutionState == ExecutionState.Stopped; 327 } 317 328 } 318 329 … … 411 422 412 423 /// <summary> 413 /// Creates a SerializedJobobject containing the Job and the IJob-Object as byte[]424 /// Creates a JobData object containing the Job and the IJob-Object as byte[] 414 425 /// </summary> 415 426 /// <param name="withoutChildOptimizers"> 416 427 /// if true the Child-Optimizers will not be serialized (if the job contains an Experiment) 417 428 /// </param> 418 public JobData GetAsSerializedJob(bool withoutChildOptimizers) { 429 public JobData GetAsJobData(bool withoutChildOptimizers) { 430 if (this.optimizerJob == null || this.optimizerJob.Optimizer == null) 431 return null; 432 419 433 byte[] jobByteArray; 420 434 if (withoutChildOptimizers && this.OptimizerJob.Optimizer is Optimization.Experiment) { … … 435 449 UpdateRequiredPlugins(); 436 450 437 JobData serializedJob= new JobData() {451 JobData jobData = new JobData() { 438 452 JobId = job.Id, 439 453 Data = jobByteArray 440 454 }; 441 455 442 return serializedJob;456 return jobData; 443 457 } 444 458 … … 447 461 /// </summary> 448 462 private void UpdateRequiredPlugins() { 449 //this.Job.PluginsNeeded = HivePluginInfoDto.FindPluginsNeeded(optimizerJob.GetType()); 450 throw new NotImplementedException(); 463 List<Guid> pluginList = new List<Guid>(); 464 465 IEnumerable<IPluginDescription> neededPlugins = ApplicationManager.Manager.Plugins; //HivePluginInfoDto.FindPluginsNeeded(optimizerJob.GetType()); 466 using (var service = ServiceLocator.Instance.ServicePool.GetService()) { 467 IEnumerable<Plugin> availablePlugins = service.Obj.GetAvailablePlugins(); 468 foreach (IPluginDescription neededPlugin in neededPlugins) { 469 Plugin found = availablePlugins.Where(availablePlugin => availablePlugin.Name == neededPlugin.Name && availablePlugin.Version.Major == neededPlugin.Version.Major && availablePlugin.Version.Minor == neededPlugin.Version.Minor && availablePlugin.Version.Revision == neededPlugin.Version.Revision && availablePlugin.Version.MinorRevision == neededPlugin.Version.MinorRevision).SingleOrDefault(); 470 if (found != null) { 471 pluginList.Add(found.Id); 472 } else { 473 Plugin p = new Plugin() { Name = neededPlugin.Name, Version = neededPlugin.Version }; 474 List<PluginData> pluginDatas = new List<PluginData>(); 475 476 foreach (IPluginFile pf in neededPlugin.Files) { 477 PluginData pluginData = new PluginData(); 478 479 pluginData.Data = File.ReadAllBytes(pf.Name); 480 pluginDatas.Add(pluginData); 481 } 482 pluginList.Add(service.Obj.AddPlugin(p, pluginDatas)); 483 } 484 } 485 } 486 this.Job.PluginsNeededIds = pluginList; 451 487 } 452 488 -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/Properties/Settings.Designer.cs
r4629 r4905 14 14 [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 15 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 internalsealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {16 public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 17 18 18 private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/ServiceLocator.cs
r4629 r4905 24 24 25 25 namespace HeuristicLab.Clients.Hive { 26 internalclass ServiceLocator {26 public class ServiceLocator { 27 27 private static ServiceLocator instance = null; 28 28 private ServiceClientFactory<IHiveService> serviceFactory = null; … … 51 51 get { 52 52 if (serviceFactory == null) { 53 serviceFactory = new ServiceClientFactory<IHiveService>(Settings.Default.HiveUsername, Settings.Default.HivePassword, " TcpEndpoint");53 serviceFactory = new ServiceClientFactory<IHiveService>(Settings.Default.HiveUsername, Settings.Default.HivePassword, "wsHttpBinding_IHiveService"); 54 54 } 55 55 return serviceFactory; -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/app.config
r4649 r4905 4 4 <bindings> 5 5 <wsHttpBinding> 6 <binding name="HttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" 7 receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" 8 transactionFlow="false" hostNameComparisonMode="StrongWildcard" 9 maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 10 messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 11 allowCookies="false"> 12 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 13 maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 14 <reliableSession ordered="true" inactivityTimeout="00:10:00" 15 enabled="false" /> 16 <security mode="Message"> 17 <transport clientCredentialType="Windows" proxyCredentialType="None" 18 realm="" /> 19 <message clientCredentialType="Windows" negotiateServiceCredential="true" 20 algorithmSuite="Default" /> 21 </security> 6 <binding name="wsHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> 7 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/> 8 <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/> 9 <security mode="Message"> 10 <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/> 11 <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default"/> 12 </security> 22 13 </binding> 23 </wsHttpBinding>24 </bindings>14 </wsHttpBinding> 15 </bindings> 25 16 <client> 26 <endpoint address="http://localhost:9000/HiveService" binding="wsHttpBinding" 27 bindingConfiguration="HttpBinding" contract="HeuristicLab.Clients.Hive.IHiveService" 28 name="HttpBinding"> 29 <identity> 30 <userPrincipalName value="S0920454044@hagenberg.fhooe.at" /> 31 </identity> 17 <endpoint address="http://localhost:9000/Hive-3.3" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="HeuristicLab.Services.Hive.Common.ServiceContracts.IHiveService" name="wsHttpBinding_IHiveService"> 18 <identity> 19 <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac="/> 20 </identity> 32 21 </endpoint> 33 22 </client> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Hive.sln
r4629 r4905 27 27 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.Hive-3.3", "HeuristicLab.Services.Hive\3.3\HeuristicLab.Services.Hive-3.3.csproj", "{CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}" 28 28 EndProject 29 Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "3.3", "HeuristicLab.Services.Hive.Web\3.3\", "{0CA6706D-A569-45DE-A85C-4158891CC1BC}" 30 ProjectSection(WebsiteProperties) = preProject 31 TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" 32 Debug.AspNetCompiler.VirtualPath = "/3.3" 33 Debug.AspNetCompiler.PhysicalPath = "HeuristicLab.Services.Hive.Web\3.3\" 34 Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\3.3\" 35 Debug.AspNetCompiler.Updateable = "true" 36 Debug.AspNetCompiler.ForceOverwrite = "true" 37 Debug.AspNetCompiler.FixedNames = "false" 38 Debug.AspNetCompiler.Debug = "True" 39 Release.AspNetCompiler.VirtualPath = "/3.3" 40 Release.AspNetCompiler.PhysicalPath = "HeuristicLab.Services.Hive.Web\3.3\" 41 Release.AspNetCompiler.TargetPath = "PrecompiledWeb\3.3\" 42 Release.AspNetCompiler.Updateable = "true" 43 Release.AspNetCompiler.ForceOverwrite = "true" 44 Release.AspNetCompiler.FixedNames = "false" 45 Release.AspNetCompiler.Debug = "False" 46 VWDPort = "1649" 47 DefaultWebSiteLanguage = "Visual C#" 48 EndProjectSection 49 EndProject 50 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{753CD427-5A39-4B11-8B6D-84D588D65D98}" 51 EndProject 29 52 Global 30 53 GlobalSection(SolutionConfigurationPlatforms) = preSolution 31 54 Debug|Any CPU = Debug|Any CPU 55 Debug|Mixed Platforms = Debug|Mixed Platforms 56 Debug|x86 = Debug|x86 32 57 Release|Any CPU = Release|Any CPU 58 Release|Mixed Platforms = Release|Mixed Platforms 59 Release|x86 = Release|x86 33 60 EndGlobalSection 34 61 GlobalSection(ProjectConfigurationPlatforms) = postSolution 35 62 {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 36 63 {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Debug|Any CPU.Build.0 = Debug|Any CPU 64 {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 65 {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 66 {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Debug|x86.ActiveCfg = Debug|Any CPU 37 67 {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Release|Any CPU.ActiveCfg = Release|Any CPU 38 68 {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Release|Any CPU.Build.0 = Release|Any CPU 69 {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 70 {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Release|Mixed Platforms.Build.0 = Release|Any CPU 71 {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Release|x86.ActiveCfg = Release|Any CPU 39 72 {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 40 73 {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Debug|Any CPU.Build.0 = Debug|Any CPU 74 {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 75 {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 76 {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Debug|x86.ActiveCfg = Debug|Any CPU 41 77 {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Release|Any CPU.ActiveCfg = Release|Any CPU 42 78 {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Release|Any CPU.Build.0 = Release|Any CPU 79 {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 80 {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Release|Mixed Platforms.Build.0 = Release|Any CPU 81 {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Release|x86.ActiveCfg = Release|Any CPU 43 82 {14424A16-48D4-445E-80BF-DDF617548BBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 44 83 {14424A16-48D4-445E-80BF-DDF617548BBB}.Debug|Any CPU.Build.0 = Debug|Any CPU 84 {14424A16-48D4-445E-80BF-DDF617548BBB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 85 {14424A16-48D4-445E-80BF-DDF617548BBB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 86 {14424A16-48D4-445E-80BF-DDF617548BBB}.Debug|x86.ActiveCfg = Debug|Any CPU 45 87 {14424A16-48D4-445E-80BF-DDF617548BBB}.Release|Any CPU.ActiveCfg = Release|Any CPU 46 88 {14424A16-48D4-445E-80BF-DDF617548BBB}.Release|Any CPU.Build.0 = Release|Any CPU 89 {14424A16-48D4-445E-80BF-DDF617548BBB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 90 {14424A16-48D4-445E-80BF-DDF617548BBB}.Release|Mixed Platforms.Build.0 = Release|Any CPU 91 {14424A16-48D4-445E-80BF-DDF617548BBB}.Release|x86.ActiveCfg = Release|Any CPU 47 92 {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 48 93 {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Debug|Any CPU.Build.0 = Debug|Any CPU 94 {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 95 {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 96 {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Debug|x86.ActiveCfg = Debug|Any CPU 49 97 {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Release|Any CPU.ActiveCfg = Release|Any CPU 50 98 {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Release|Any CPU.Build.0 = Release|Any CPU 99 {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 100 {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Release|Mixed Platforms.Build.0 = Release|Any CPU 101 {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Release|x86.ActiveCfg = Release|Any CPU 51 102 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 52 103 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|Any CPU.Build.0 = Debug|Any CPU 104 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 105 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 106 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|x86.ActiveCfg = Debug|Any CPU 53 107 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|Any CPU.ActiveCfg = Release|Any CPU 54 108 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|Any CPU.Build.0 = Release|Any CPU 109 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 110 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|Mixed Platforms.Build.0 = Release|Any CPU 111 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|x86.ActiveCfg = Release|Any CPU 55 112 {E1D6C801-892A-406A-B606-F158E36DD3C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 56 113 {E1D6C801-892A-406A-B606-F158E36DD3C3}.Debug|Any CPU.Build.0 = Debug|Any CPU 114 {E1D6C801-892A-406A-B606-F158E36DD3C3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 115 {E1D6C801-892A-406A-B606-F158E36DD3C3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 116 {E1D6C801-892A-406A-B606-F158E36DD3C3}.Debug|x86.ActiveCfg = Debug|Any CPU 57 117 {E1D6C801-892A-406A-B606-F158E36DD3C3}.Release|Any CPU.ActiveCfg = Release|Any CPU 58 118 {E1D6C801-892A-406A-B606-F158E36DD3C3}.Release|Any CPU.Build.0 = Release|Any CPU 119 {E1D6C801-892A-406A-B606-F158E36DD3C3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 120 {E1D6C801-892A-406A-B606-F158E36DD3C3}.Release|Mixed Platforms.Build.0 = Release|Any CPU 121 {E1D6C801-892A-406A-B606-F158E36DD3C3}.Release|x86.ActiveCfg = Release|Any CPU 59 122 {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 60 123 {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Debug|Any CPU.Build.0 = Debug|Any CPU 124 {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 125 {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 126 {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Debug|x86.ActiveCfg = Debug|Any CPU 61 127 {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Release|Any CPU.ActiveCfg = Release|Any CPU 62 128 {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Release|Any CPU.Build.0 = Release|Any CPU 129 {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 130 {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Release|Mixed Platforms.Build.0 = Release|Any CPU 131 {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Release|x86.ActiveCfg = Release|Any CPU 63 132 {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 64 133 {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Debug|Any CPU.Build.0 = Debug|Any CPU 134 {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 135 {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 136 {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Debug|x86.ActiveCfg = Debug|Any CPU 65 137 {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Release|Any CPU.ActiveCfg = Release|Any CPU 66 138 {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Release|Any CPU.Build.0 = Release|Any CPU 139 {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 140 {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Release|Mixed Platforms.Build.0 = Release|Any CPU 141 {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Release|x86.ActiveCfg = Release|Any CPU 142 {0CA6706D-A569-45DE-A85C-4158891CC1BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 143 {0CA6706D-A569-45DE-A85C-4158891CC1BC}.Debug|Any CPU.Build.0 = Debug|Any CPU 144 {0CA6706D-A569-45DE-A85C-4158891CC1BC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 145 {0CA6706D-A569-45DE-A85C-4158891CC1BC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 146 {0CA6706D-A569-45DE-A85C-4158891CC1BC}.Debug|x86.ActiveCfg = Debug|Any CPU 147 {0CA6706D-A569-45DE-A85C-4158891CC1BC}.Release|Any CPU.ActiveCfg = Debug|Any CPU 148 {0CA6706D-A569-45DE-A85C-4158891CC1BC}.Release|Any CPU.Build.0 = Debug|Any CPU 149 {0CA6706D-A569-45DE-A85C-4158891CC1BC}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU 150 {0CA6706D-A569-45DE-A85C-4158891CC1BC}.Release|Mixed Platforms.Build.0 = Debug|Any CPU 151 {0CA6706D-A569-45DE-A85C-4158891CC1BC}.Release|x86.ActiveCfg = Debug|Any CPU 152 {753CD427-5A39-4B11-8B6D-84D588D65D98}.Debug|Any CPU.ActiveCfg = Debug|x86 153 {753CD427-5A39-4B11-8B6D-84D588D65D98}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 154 {753CD427-5A39-4B11-8B6D-84D588D65D98}.Debug|Mixed Platforms.Build.0 = Debug|x86 155 {753CD427-5A39-4B11-8B6D-84D588D65D98}.Debug|x86.ActiveCfg = Debug|x86 156 {753CD427-5A39-4B11-8B6D-84D588D65D98}.Debug|x86.Build.0 = Debug|x86 157 {753CD427-5A39-4B11-8B6D-84D588D65D98}.Release|Any CPU.ActiveCfg = Release|Any CPU 158 {753CD427-5A39-4B11-8B6D-84D588D65D98}.Release|Any CPU.Build.0 = Release|Any CPU 159 {753CD427-5A39-4B11-8B6D-84D588D65D98}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 160 {753CD427-5A39-4B11-8B6D-84D588D65D98}.Release|Mixed Platforms.Build.0 = Release|Any CPU 161 {753CD427-5A39-4B11-8B6D-84D588D65D98}.Release|x86.ActiveCfg = Release|x86 162 {753CD427-5A39-4B11-8B6D-84D588D65D98}.Release|x86.Build.0 = Release|x86 67 163 EndGlobalSection 68 164 GlobalSection(SolutionProperties) = preSolution -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HiveItemBase.cs
r4796 r4905 10 10 [DataContract] 11 11 [Serializable] 12 public abstract class HiveItemBase : DeepCloneable {12 public abstract class HiveItemBase : IDeepCloneable { 13 13 protected HiveItemBase() { } 14 protected HiveItemBase(HiveItemBase original, Cloner cloner) : base(original, cloner) { } 14 protected HiveItemBase(HiveItemBase original, Cloner cloner) { 15 cloner.RegisterClonedObject(original, this); 16 } 17 18 public abstract IDeepCloneable Clone(Cloner cloner); 19 20 public object Clone() { 21 return Clone(new Cloner()); 22 } 15 23 } 16 24 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Job.cs
r4796 r4905 40 40 [DataMember] 41 41 public Guid? ProjectId { get; set; } 42 [DataMember] 43 public List<Guid> PluginsNeededIds { get; set; } 42 44 43 45 public Job() { } … … 48 50 this.MemoryNeeded = original.MemoryNeeded; 49 51 this.ProjectId = original.ProjectId; 52 this.PluginsNeededIds = new List<Guid>(original.PluginsNeededIds); 50 53 } 51 54 public override IDeepCloneable Clone(Cloner cloner) { … … 56 59 return string.Format("State: {0}, SlaveId: {1}, DateCreated: {2}, DateCalculated: {3}, CoresNeeded: {4}, MemoryNeeded: {5}", JobState, SlaveId, DateCreated, DateCalculated, CoresNeeded, MemoryNeeded); 57 60 } 61 58 62 } 59 63 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/HeuristicLab.Services.Hive.Common-3.3.csproj
r4649 r4905 68 68 <Compile Include="DataTransfer\HiveItem.cs" /> 69 69 <Compile Include="DataTransfer\HiveItemBase.cs" /> 70 <Compile Include="DataTransfer\ HivePluginData.cs" />71 <Compile Include="DataTransfer\ HivePlugin.cs" />70 <Compile Include="DataTransfer\PluginData.cs" /> 71 <Compile Include="DataTransfer\Plugin.cs" /> 72 72 <Compile Include="DataTransfer\Job.cs" /> 73 73 <Compile Include="DataTransfer\LightweightJob.cs" /> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/MessageContainer.cs
r4796 r4905 31 31 [StorableClass] 32 32 [Serializable] 33 public class MessageContainer : DeepCloneable {33 public class MessageContainer : IDeepCloneable { 34 34 35 35 public enum MessageType { … … 69 69 JobId = jobId; 70 70 } 71 protected MessageContainer(MessageContainer original, Cloner cloner) : base(original, cloner) { 71 protected MessageContainer(MessageContainer original, Cloner cloner) { 72 cloner.RegisterClonedObject(original, this); 72 73 this.Message = original.Message; 73 74 this.JobId = original.JobId; 74 75 } 75 public overrideIDeepCloneable Clone(Cloner cloner) {76 public virtual IDeepCloneable Clone(Cloner cloner) { 76 77 return new MessageContainer(this, cloner); 78 } 79 public object Clone() { 80 return Clone(new Cloner()); 77 81 } 78 82 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/ServiceContracts/IHiveService.cs
r4649 r4905 15 15 #region Job Methods 16 16 [OperationContract] 17 Guid AddJob(Job job Dto, JobData jobDataDto);17 Guid AddJob(Job job, JobData jobData); 18 18 19 19 [OperationContract] 20 Guid AddChildJob(Guid parentJobId, Job job Dto, JobData jobDataDto);20 Guid AddChildJob(Guid parentJobId, Job job, JobData jobData); 21 21 22 22 [OperationContract] // formerly GetJobById … … 78 78 79 79 [OperationContract] 80 Job PauseJob( JobData serializedJob);80 Job PauseJob(Guid jobId); 81 81 #endregion 82 82 … … 138 138 #region Plugin Methods 139 139 [OperationContract] 140 IEnumerable< HivePluginData> GetPlugins(List<HivePlugin> pluginList);140 IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds); 141 141 [OperationContract] 142 Stream GetStreamedPlugins(List<HivePlugin> pluginList); 142 Stream GetStreamedPluginDatas(List<Guid> pluginIds); 143 [OperationContract] 144 IEnumerable<Plugin> GetAvailablePlugins(); 145 [OperationContract] 146 Guid AddPlugin(Plugin plugin, List<PluginData> pluginData); 143 147 #endregion 144 148 -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Convert.cs
r4649 r4905 45 45 SlaveId = source.SlaveId, 46 46 JobState = source.JobState, 47 UserId = source.UserId 47 UserId = source.UserId, 48 PluginsNeededIds = source.RequiredPlugins.Select(x => x.PluginId).ToList() 48 49 }; 49 50 } … … 69 70 target.JobState = source.JobState; 70 71 target.UserId = source.UserId; 72 // target.RequiredPlugins = db.Plugins.Select(x => source.PluginsNeededIds.Contains(x.PluginId)); - this is difficult 71 73 } 72 74 } … … 107 109 #endregion 108 110 111 #region Plugin 112 public static DT.Plugin ToDto(Plugin source) { 113 if (source == null) return null; 114 return new DT.Plugin { Id = source.PluginId, Name = source.Name, Version = new Version(source.Version) }; 115 } 116 public static Plugin ToEntity(DT.Plugin source) { 117 if (source == null) return null; 118 var entity = new Plugin(); ToEntity(source, entity); 119 return entity; 120 } 121 public static void ToEntity(DT.Plugin source, Plugin target) { 122 if ((source != null) && (target != null)) { 123 target.PluginId = source.Id; target.Name = source.Name; target.Version = source.Version.ToString(); 124 } 125 } 126 #endregion 127 128 #region PluginData 129 public static DT.PluginData ToDto(PluginData source) { 130 if (source == null) return null; 131 return new DT.PluginData { PluginId = source.PluginId, Data = source.Data.ToArray() }; 132 } 133 public static PluginData ToEntity(DT.PluginData source) { 134 if (source == null) return null; 135 var entity = new PluginData(); ToEntity(source, entity); 136 return entity; 137 } 138 public static void ToEntity(DT.PluginData source, PluginData target) { 139 if ((source != null) && (target != null)) { 140 target.PluginId = source.PluginId; target.Data = new Binary(source.Data); 141 } 142 } 143 #endregion 144 109 145 #region Slave 110 146 public static DT.Slave ToDto(Slave source) { … … 137 173 if ((source != null) && (target != null)) { 138 174 target.ResourceId = source.Id; 139 target.Name = source.Name; 175 target.Name = source.Name; 140 176 //target.SlaveGroup_Resources_Children = // TODO: see how working with groups will work, then decide how to handle enumerations in here 141 177 //target.SlaveGroup_Resources_Parents = -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
r4796 r4905 50 50 <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 51 51 </Reference> 52 <Reference Include="HeuristicLab.Tracing-3.3, Version=3.2.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 52 <Reference Include="HeuristicLab.Tracing-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 53 <SpecificVersion>False</SpecificVersion> 54 <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Tracing-3.3.dll</HintPath> 55 </Reference> 53 56 <Reference Include="System" /> 54 57 <Reference Include="System.Core" /> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs
r4649 r4905 11 11 12 12 public class HiveDao : IHiveDao { 13 public HiveDataContext CreateContext() {13 public static HiveDataContext CreateContext() { 14 14 return new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString); 15 15 } … … 74 74 } 75 75 76 public IEnumerable<DT.Job> Get AvailableJobs(DT.Slave slave) {76 public IEnumerable<DT.Job> GetWaitingJobs(DT.Slave slave) { 77 77 using (var db = CreateContext()) { 78 78 var query = from j in db.Jobs … … 166 166 #endregion 167 167 168 #region Plugin Methods 169 public DT.Plugin GetPlugin(Guid id) { 170 using (var db = CreateContext()) { 171 return Convert.ToDto(db.Plugins.SingleOrDefault(x => x.PluginId == id)); 172 } 173 } 174 175 public IEnumerable<DT.Plugin> GetPlugins(Expression<Func<Plugin, bool>> predicate) { 176 using (var db = CreateContext()) { 177 return db.Plugins.Where(predicate).Select(x => Convert.ToDto(x)).ToArray(); 178 } 179 } 180 181 public Guid AddPlugin(DT.Plugin dto) { 182 using (var db = CreateContext()) { 183 var entity = Convert.ToEntity(dto); 184 db.Plugins.InsertOnSubmit(entity); 185 db.SubmitChanges(); 186 return entity.PluginId; 187 } 188 } 189 190 public void UpdatePlugin(DT.Plugin dto) { 191 using (var db = CreateContext()) { 192 var entity = db.Plugins.FirstOrDefault(x => x.PluginId == dto.Id); 193 if (entity == null) db.Plugins.InsertOnSubmit(Convert.ToEntity(dto)); 194 else Convert.ToEntity(dto, entity); 195 db.SubmitChanges(); 196 } 197 } 198 199 public void DeletePlugin(Guid id) { 200 using (var db = CreateContext()) { 201 var entity = db.Plugins.FirstOrDefault(x => x.PluginId == id); 202 if (entity != null) db.Plugins.DeleteOnSubmit(entity); 203 db.SubmitChanges(); 204 } 205 } 206 #endregion 207 208 #region PluginData Methods 209 210 public DT.PluginData GetPluginData(Guid id) { 211 using (var db = CreateContext()) { 212 return Convert.ToDto(db.PluginDatas.SingleOrDefault(x => x.PluginId == id)); 213 } 214 } 215 216 public IEnumerable<DT.PluginData> GetPluginDatas(Expression<Func<PluginData, bool>> predicate) { 217 using (var db = CreateContext()) { 218 return db.PluginDatas.Where(predicate).Select(x => Convert.ToDto(x)).ToArray(); 219 } 220 } 221 222 public Guid AddPluginData(DT.PluginData dto) { 223 using (var db = CreateContext()) { 224 var entity = Convert.ToEntity(dto); 225 db.PluginDatas.InsertOnSubmit(entity); 226 db.SubmitChanges(); 227 return entity.PluginId; 228 } 229 } 230 231 public void UpdatePluginData(DT.PluginData dto) { 232 using (var db = CreateContext()) { 233 var entity = db.PluginDatas.FirstOrDefault(x => x.PluginId == dto.PluginId); 234 if (entity == null) db.PluginDatas.InsertOnSubmit(Convert.ToEntity(dto)); 235 else Convert.ToEntity(dto, entity); 236 db.SubmitChanges(); 237 } 238 } 239 240 public void DeletePluginData(Guid id) { 241 using (var db = CreateContext()) { 242 var entity = db.PluginDatas.FirstOrDefault(x => x.PluginId == id); // check if all the byte[] is loaded into memory here. otherwise work around to delete without loading it 243 if (entity != null) db.PluginDatas.DeleteOnSubmit(entity); 244 db.SubmitChanges(); 245 } 246 } 247 #endregion 248 168 249 #region Slave Methods 169 250 public DT.Slave GetSlave(Guid id) { -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
r4649 r4905 40 40 <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 41 41 <Column Name="Version" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 42 <Column Name="BuildDate" Type="System.String" DbType="VarChar(20)" CanBeNull="false" />43 42 <Association Name="Plugin_RequiredPlugin" Member="RequiredPlugins" ThisKey="PluginId" OtherKey="PluginId" Type="RequiredPlugin" /> 44 43 <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" Cardinality="One" /> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout
r4615 r4905 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 17.25, 12. 5" name="HiveDataContext">2 <ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 17.25, 12.25" name="HiveDataContext"> 3 3 <DataContextMoniker Name="/HiveDataContext" /> 4 4 <nestedChildShapes> … … 27 27 </nestedChildShapes> 28 28 </classShape> 29 <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9, 10.625, 2, 1. 5785953776041666">29 <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9, 10.625, 2, 1.3862939453125005"> 30 30 <DataClassMoniker Name="/HiveDataContext/Plugin" /> 31 31 <nestedChildShapes> 32 <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="9.015, 11.085, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />32 <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="9.015, 11.085, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 33 33 </nestedChildShapes> 34 34 </classShape> … … 189 189 </nestedChildShapes> 190 190 </classShape> 191 <associationConnector edgePoints="[(11 : 11.2219962565104); (11.5 : 11.2219962565104)]" fixedFrom=" NotFixed" fixedTo="NotFixed">191 <associationConnector edgePoints="[(11 : 11.2219962565104); (11.5 : 11.2219962565104)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 192 192 <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" /> 193 193 <nodes> … … 203 203 </nodes> 204 204 </associationConnector> 205 <associationConnector edgePoints="[(10.125 : 10.625); (10.125 : 10.2612939453125)]" fixedFrom=" NotFixed" fixedTo="NotFixed">205 <associationConnector edgePoints="[(10.125 : 10.625); (10.125 : 10.2612939453125)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 206 206 <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" /> 207 207 <nodes> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
r4649 r4905 907 907 private string _Version; 908 908 909 private string _BuildDate;910 911 909 private EntitySet<RequiredPlugin> _RequiredPlugins; 912 910 … … 921 919 partial void OnVersionChanging(string value); 922 920 partial void OnVersionChanged(); 923 partial void OnBuildDateChanging(string value);924 partial void OnBuildDateChanged();925 921 #endregion 926 922 … … 987 983 this.SendPropertyChanged("Version"); 988 984 this.OnVersionChanged(); 989 }990 }991 }992 993 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BuildDate", DbType="VarChar(20)", CanBeNull=false)]994 public string BuildDate995 {996 get997 {998 return this._BuildDate;999 }1000 set1001 {1002 if ((this._BuildDate != value))1003 {1004 this.OnBuildDateChanging(value);1005 this.SendPropertyChanging();1006 this._BuildDate = value;1007 this.SendPropertyChanged("BuildDate");1008 this.OnBuildDateChanged();1009 985 } 1010 986 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs
r4629 r4905 15 15 void UpdateJob(DT.Job dto); 16 16 void DeleteJob(Guid id); 17 IEnumerable<DT.Job> Get AvailableJobs(DT.Slave slave);17 IEnumerable<DT.Job> GetWaitingJobs(DT.Slave slave); 18 18 #endregion 19 19 … … 35 35 36 36 #region Plugin Methods 37 DT.Plugin GetPlugin(Guid id); 38 IEnumerable<DT.Plugin> GetPlugins(Expression<Func<Plugin, bool>> predicate); 39 Guid AddPlugin(DT.Plugin dto); 40 void UpdatePlugin(DT.Plugin dto); 41 void DeletePlugin(Guid id); 37 42 #endregion 38 43 39 44 #region PluginData Methods 45 DT.PluginData GetPluginData(Guid id); 46 IEnumerable<DT.PluginData> GetPluginDatas(Expression<Func<PluginData, bool>> predicate); 47 Guid AddPluginData(DT.PluginData dto); 48 void UpdatePluginData(DT.PluginData dto); 49 void DeletePluginData(Guid id); 40 50 #endregion 41 51 -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Tools/CreateHiveDatabaseApplication.cs
r4649 r4905 27 27 28 28 public override void Run() { 29 var dao = new HiveDao(); 30 using (var db = dao.CreateContext()) { 29 using (var db = HiveDao.CreateContext()) { 31 30 if (db.DatabaseExists()) 32 31 db.DeleteDatabase(); -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Tools/prepareHiveDatabase.sql
r4629 r4905 31 31 ALTER TABLE dbo.AssignedResources ALTER COLUMN AssignedRessourcesId ADD ROWGUIDCOL; 32 32 ALTER TABLE dbo.AssignedResources WITH NOCHECK ADD CONSTRAINT [DF_AssignedResources_AssignedRessourcesId] DEFAULT (newid()) FOR AssignedRessourcesId; 33 ALTER TABLE [dbo].[AssignedResources] DROP CONSTRAINT [Job_AssignedResource] 34 ALTER TABLE [dbo].[AssignedResources] WITH CHECK ADD CONSTRAINT [Job_AssignedResource] FOREIGN KEY([JobId]) 35 REFERENCES [dbo].[Job] ([JobId]) 36 ON UPDATE CASCADE 37 ON DELETE CASCADE 38 GO 39 ALTER TABLE [dbo].[AssignedResources] DROP CONSTRAINT [Resource_AssignedResource] 40 ALTER TABLE [dbo].[AssignedResources] WITH CHECK ADD CONSTRAINT [Resource_AssignedResource] FOREIGN KEY([ResourceId]) 41 REFERENCES [dbo].[Resource] ([ResourceId]) 42 ON UPDATE CASCADE 43 ON DELETE CASCADE 44 GO 33 45 34 46 ALTER TABLE dbo.Job ALTER COLUMN JobId ADD ROWGUIDCOL; … … 50 62 ALTER TABLE dbo.RequiredPlugins WITH NOCHECK ADD CONSTRAINT [DF_RequiredPlugins_RequiredPluginId] DEFAULT (newid()) FOR RequiredPluginId; 51 63 64 ALTER TABLE [dbo].[RequiredPlugins] DROP CONSTRAINT [Job_RequiredPlugin] 65 ALTER TABLE [dbo].[RequiredPlugins] WITH CHECK ADD CONSTRAINT [Job_RequiredPlugin] FOREIGN KEY([JobId]) 66 REFERENCES [dbo].[Job] ([JobId]) 67 ON UPDATE CASCADE 68 ON DELETE CASCADE 69 GO 70 71 ALTER TABLE [dbo].[RequiredPlugins] DROP CONSTRAINT [Plugin_RequiredPlugin] 72 ALTER TABLE [dbo].[RequiredPlugins] WITH CHECK ADD CONSTRAINT [Plugin_RequiredPlugin] FOREIGN KEY([PluginId]) 73 REFERENCES [dbo].[Plugin] ([PluginId]) 74 ON UPDATE CASCADE 75 ON DELETE CASCADE 76 GO 77 52 78 ALTER TABLE dbo.Resource ALTER COLUMN ResourceId ADD ROWGUIDCOL; 53 79 ALTER TABLE dbo.Resource WITH NOCHECK ADD CONSTRAINT [DF_Resource_ResourceId] DEFAULT (newid()) FOR ResourceId; … … 64 90 /* create indices */ 65 91 CREATE INDEX Index_RequiredPlugins_JobId ON RequiredPlugins(JobId); 92 93 /* triggers */ 94 SET ANSI_NULLS ON 95 GO 96 SET QUOTED_IDENTIFIER ON 97 GO 98 -- ============================================= 99 -- Author: cneumuel 100 -- Create date: 11.11.2010 101 -- Description: Deletes the root-job of the experiment when experiment is deleted 102 -- ============================================= 103 CREATE TRIGGER [dbo].[tr_HiveExperimentDeleteCascade] ON [dbo].[HiveExperiment] FOR DELETE AS 104 SET NOCOUNT ON 105 DELETE Job FROM deleted, Job WHERE Job.JobId = deleted.RootJobId 106 GO 107 108 SET ANSI_NULLS ON 109 GO 110 SET QUOTED_IDENTIFIER ON 111 GO 112 -- ============================================= 113 -- Author: cneumuel 114 -- Create date: 11.11.2010 115 -- Description: Recursively deletes all child-jobs of a job when it is deleted. (Source: http://devio.wordpress.com/2008/05/23/recursive-delete-in-sql-server/) 116 -- ============================================= 117 CREATE TRIGGER [dbo].[tr_JobDeleteCascade] ON [dbo].[Job] INSTEAD OF DELETE AS 118 BEGIN 119 CREATE TABLE #Table( 120 JobId uniqueidentifier 121 ) 122 INSERT INTO #Table (JobId) 123 SELECT JobId FROM deleted 124 125 DECLARE @c INT 126 SET @c = 0 127 128 WHILE @c <> (SELECT COUNT(JobId) FROM #Table) BEGIN 129 SELECT @c = COUNT(JobId) FROM #Table 130 131 INSERT INTO #Table (JobId) 132 SELECT Job.JobId 133 FROM Job 134 LEFT OUTER JOIN #Table ON Job.JobId = #Table.JobId 135 WHERE Job.ParentJobId IN (SELECT JobId FROM #Table) 136 AND #Table.JobId IS NULL 137 END 138 139 DELETE Job FROM Job INNER JOIN #Table ON Job.JobId = #Table.JobId 140 END -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/MergeConfigs.cmd
r4649 r4905 3 3 %SolutionDir%ConfigMerger "%SolutionDir%HeuristicLab.Services.Hive\3.3\app.config" "%TargetDir%HeuristicLab.Hive-3.3.dll.config" 4 4 %SolutionDir%ConfigMerger "%SolutionDir%HeuristicLab.Services.Hive.DataAccess\3.3\app.config" "%TargetDir%HeuristicLab.Hive-3.3.dll.config" 5 %SolutionDir%ConfigMerger "%SolutionDir%HeuristicLab.Clients.Hive\3.3\app.config" "%TargetDir%HeuristicLab.Hive-3.3.dll.config" 5 6 6 7 copy "%SolutionDir%HeuristicLab 3.3.exe.config" "%TargetDir%" -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/HeuristicLab.Hive.Slave.Communication-3.3.csproj
r4810 r4905 126 126 <ItemGroup> 127 127 <None Include="app-services.heuristiclab.com.config" /> 128 <None Include="app-localhost.config" /> 128 <None Include="app-localhost.config"> 129 <SubType>Designer</SubType> 130 </None> 129 131 <None Include="app.config" /> 130 132 <None Include="HeuristicLab.snk" /> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/app.config
r4810 r4905 19 19 </netTcpBinding> 20 20 <wsHttpBinding> 21 <binding name="SlaveHttpEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize=" 65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">22 <readerQuotas maxDepth="32" maxStringContentLength=" 8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>21 <binding name="SlaveHttpEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="104857600" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> 22 <readerQuotas maxDepth="32" maxStringContentLength="104857600" maxArrayLength="104857600" maxBytesPerRead="104857600" maxNameTableCharCount="104857600"/> 23 23 <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/> 24 24 <security mode="Message"> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/PluginCache.cs
r4810 r4905 139 139 Logger.Debug("creating new files"); 140 140 foreach (HivePluginFile pf in updateablePlugin.PluginFiles) { 141 string x = PluginRepositoryDir + pf.Name.Split('\\').Last();142 string y = Path.Combine(PluginRepositoryDir, Path.GetFileName(pf.Name));143 141 File.WriteAllBytes(Path.Combine(PluginRepositoryDir, Path.GetFileName(pf.Name)), pf.BinaryFile); 144 142 }
Note: See TracChangeset
for help on using the changeset viewer.