Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4905


Ignore:
Timestamp:
11/22/10 17:13:27 (13 years ago)
Author:
cneumuel
Message:

#1233

  • added plugin management features
  • took over client-GUI from old branch
  • merged with bugfixes from old branch
  • added hive-web (for IIS)
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  
        11*.suo
         2Tests
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive.Slave.Views/3.3/HeuristicLab.Clients.Hive.Slave.Views-3.3.csproj

    r4629 r4905  
    99    <OutputType>Library</OutputType>
    1010    <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>
    1313    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    1414    <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  
    3838  </PropertyGroup>
    3939  <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>
    4043    <Reference Include="HeuristicLab.Common-3.3">
    4144      <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
    4245    </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>
    4349    <Reference Include="HeuristicLab.Core-3.3">
    4450      <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>
    4569    </Reference>
    4670    <Reference Include="HeuristicLab.Persistence-3.3">
     
    5276    <Reference Include="System" />
    5377    <Reference Include="System.Core" />
     78    <Reference Include="System.Drawing" />
     79    <Reference Include="System.Windows.Forms" />
    5480    <Reference Include="System.Xml.Linq" />
    5581    <Reference Include="System.Data.DataSetExtensions" />
     
    5884  </ItemGroup>
    5985  <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" />
    60124    <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>
    61131    <Compile Include="Properties\AssemblyInfo.cs" />
    62132  </ItemGroup>
    63133  <ItemGroup>
    64134    <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>
    65166  </ItemGroup>
    66167  <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  
    4545      <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
    4646    </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>
    4851    <Reference Include="HeuristicLab.Core-3.3">
    4952      <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
     
    6164      <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
    6265    </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>
    6470    <Reference Include="System" />
    6571    <Reference Include="System.Core" />
     
    7682    <Compile Include="Exceptions\JobResultPollingException.cs" />
    7783    <Compile Include="Exceptions\OptimizerNotFoundException.cs" />
     84    <Compile Include="HiveExperiment\PluginClient.cs" />
    7885    <Compile Include="Jobs\OptimizerJob.cs" />
    7986    <Compile Include="HeuristicLabClientsHivePlugin.cs" />
    80     <Compile Include="HiveExperiment\HiveClient.cs" />
     87    <Compile Include="HiveExperiment\HiveExperimentManagerClient.cs" />
    8188    <Compile Include="HiveExperiment\HiveJobClient.cs" />
    8289    <Compile Include="HiveExperiment\HiveExperimentClient.cs" />
     
    99106    <None Include="ServiceClients\GenerateServiceClients.cmd" />
    100107    <None Include="Properties\Settings.settings">
    101       <Generator>SettingsSingleFileGenerator</Generator>
     108      <Generator>PublicSettingsSingleFileGenerator</Generator>
    102109      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    103110    </None>
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/HiveExperiment/HiveExperimentClient.cs

    r4796 r4905  
    4444    private const string itemDescription = "A runner for a single experiment, which's algorithms are executed in the Hive.";
    4545    private System.Timers.Timer timer;
     46    private DateTime lastUpdateTime;
     47    private Guid? rootJobId;
     48    private JobResultPoller jobResultPoller;
    4649
    4750    private Guid hiveExperimentId;
     
    6972    }
    7073
    71     private DateTime lastUpdateTime;
    72 
    7374    private string resourceIds;
    7475    public string ResourceIds {
     
    8283    }
    8384
    84     private Guid? rootJobId;
    85 
    8685    private bool isPollingResults;
    8786    public bool IsPollingResults {
     
    111110    }
    112111
    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;
    119114      this.ResourceIds = "MyGroup";
    120115      this.log = new Log();
    121116      InitTimer();
    122117    }
    123     public HiveExperimentClient(DT.HiveExperiment hiveExperimentDto)
    124       : this() {
     118    public HiveExperimentClient(DT.HiveExperiment hiveExperimentDto) : this() {
    125119      UpdateFromDto(hiveExperimentDto);
    126120    }
    127121    protected HiveExperimentClient(HiveExperimentClient original, Cloner cloner)
    128122      : 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;
    132126      this.log = cloner.Clone(original.log);
    133127      this.lastUpdateTime = original.lastUpdateTime;
     
    137131      return new HiveExperimentClient(this, cloner);
    138132    }
    139 
    140133
    141134    public void UpdateFromDto(DT.HiveExperiment hiveExperimentDto) {
     
    143136      this.Name = hiveExperimentDto.Name;
    144137      this.Description = hiveExperimentDto.Description;
    145       //this.ResourceIds = hiveExperimentDto.ResourceIds;
     138      // TODO: this.ResourceIds = hiveExperimentDto.ResourceIds;
    146139      this.rootJobId = hiveExperimentDto.RootJobId;
    147140    }
     
    270263      jobCount++;
    271264      this.progress.Status = string.Format("Serializing job {0} of {1}", jobCount, totalJobCount);
    272       JobData serializedJob;
     265      JobData jobData;
    273266      if (hiveJob.OptimizerJob.ComputeInParallel &&
    274267        (hiveJob.OptimizerJob.Optimizer is Optimization.Experiment || hiveJob.OptimizerJob.Optimizer is Optimization.BatchRun)) {
    275268        hiveJob.Job.JobState = JobState.WaitingForChildJobs;
    276269        hiveJob.OptimizerJob.CollectChildJobs = false; // don't collect child-jobs on slaves
    277         serializedJob = hiveJob.GetAsSerializedJob(true);
     270        jobData = hiveJob.GetAsJobData(true);
    278271      } 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);
    283276      this.progress.ProgressValue = (double)jobCount / totalJobCount;
    284277
    285278      if (parentHiveJob != null) {
    286279        //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);
    288281      } else {
    289282        // response = service.AddJobWithGroupStrings(serializedJob, groups);
    290         hiveJob.Job.Id = service.AddJob(hiveJob.Job, serializedJob);
     283        hiveJob.Job.Id = service.AddJob(hiveJob.Job, jobData);
    291284      }
    292285
     
    467460            LogMessage(hj.Job.Id, "Downloading optimizer for job");
    468461            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;
    472465            } 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              }
    474472            }
    475473          }
     
    541539          // download them first
    542540          IDictionary<Guid, Job> allJobs = new Dictionary<Guid, Job>();
    543           IDictionary<Guid, JobData> allSerializedJobs = new Dictionary<Guid, JobData>();
     541          IDictionary<Guid, JobData> allJobDatas = new Dictionary<Guid, JobData>();
    544542          foreach (LightweightJob lightweightJob in allResults) {
    545543            jobCount++;
    546544            progress.Status = string.Format("Downloading {0} of {1} jobs...", jobCount, totalJobCount);
    547545            allJobs.Add(lightweightJob.Id, service.Obj.GetJob(lightweightJob.Id));
    548             allSerializedJobs.Add(lightweightJob.Id, service.Obj.GetJobData(lightweightJob.Id));
     546            allJobDatas.Add(lightweightJob.Id, service.Obj.GetJobData(lightweightJob.Id));
    549547            progress.ProgressValue = (double)jobCount / totalJobCount;
    550548          }
    551549
    552550          jobCount = 1;
    553           progress.Status = string.Format("Deserializing {0} of {1} jobs... ({2} kb)", jobCount, totalJobCount, allSerializedJobs[this.rootJobId.Value].Data.Count() / 1024);
    554           this.HiveJob = new HiveJob(allJobs[this.rootJobId.Value], allSerializedJobs[this.rootJobId.Value], false);
    555           allSerializedJobs.Remove(this.rootJobId.Value); // reduce memory footprint
     551          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
    556554          allJobs.Remove(this.rootJobId.Value);
    557555          progress.ProgressValue = (double)jobCount / totalJobCount;
     
    570568
    571569          // build child-job tree
    572           LoadChildResults(service.Obj, this.HiveJob, allResults, allJobs, allSerializedJobs, progress, totalJobCount, ref jobCount);
     570          LoadChildResults(service.Obj, this.HiveJob, allResults, allJobs, allJobDatas, progress, totalJobCount, ref jobCount);
    573571          StartResultPolling();
    574572        }
     
    582580    }
    583581
    584     private void LoadChildResults(IHiveService service, HiveJob parentHiveJob, IEnumerable<LightweightJob> allResults, IDictionary<Guid, Job> allJobs, IDictionary<Guid, JobData> allSerializedJobs, 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) {
    585583      IEnumerable<LightweightJob> childResults = from result in allResults
    586584                                                 where result.ParentJobId.HasValue && result.ParentJobId.Value == parentHiveJob.Job.Id
     
    589587      foreach (LightweightJob lightweightJob in childResults) {
    590588        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        }
    593597        progress.ProgressValue = (double)jobCount / totalJobCount;
    594598        HiveJob childHiveJob = new HiveJob(optimizerJob, false);
    595599        parentHiveJob.AddChildHiveJob(childHiveJob);
    596600        childHiveJob.Job = allJobs[lightweightJob.Id];
    597         allSerializedJobs.Remove(lightweightJob.Id); // reduce memory footprint
     601        allJobDatas.Remove(lightweightJob.Id); // reduce memory footprint
    598602        allJobs.Remove(lightweightJob.Id);
    599603        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, allSerializedJobs, progress, totalJobCount, ref jobCount);
     604        LoadChildResults(service, childHiveJob, allResults, allJobs, allJobDatas, progress, totalJobCount, ref jobCount);
    601605      }
    602606    }
     
    604608    private OptimizerJob LoadOptimizerJob(Guid jobId) {
    605609      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        }
    608617      }
    609618    }
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/HiveExperiment/HiveJobClient.cs

    r4796 r4905  
    3131using HeuristicLab.Services.Hive.Common.DataTransfer;
    3232using HeuristicLab.Clients.Hive.Jobs;
     33using HeuristicLab.PluginInfrastructure;
     34using System.IO;
     35using HeuristicLab.PluginInfrastructure.Manager;
    3336
    3437namespace HeuristicLab.Clients.Hive {
    3538
     39  [Item("Hive Job", "Represents a hive job.")]
    3640  public class HiveJob : Item {
    3741    private static object locker = new object();
     
    136140    }
    137141
    138     public HiveJob(Job job, JobData serializedJob, bool autoCreateChildHiveJobs)
     142    public HiveJob(Job job, JobData jobData, bool autoCreateChildHiveJobs)
    139143      : this() {
    140144      this.syncJobsWithOptimizers = autoCreateChildHiveJobs;
    141145      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      }
    143152      this.syncJobsWithOptimizers = true;
    144153    }
     
    193202          batchRun.AlgorithmChanged += new EventHandler(batchRun_AlgorithmChanged);
    194203        }
    195 
    196204        OptimizerJob.ComputeInParallelChanged += new EventHandler(OptimizerJob_ComputeInParallelChanged);
    197205        OptimizerJob.ToStringChanged += new EventHandler(OptimizerJob_ToStringChanged);
     
    199207    }
    200208    private void DergisterOptimizerEvents() {
    201       if (Job != null && OptimizerJob.Optimizer is Optimization.Experiment) {
     209      if (OptimizerJob != null) {
    202210        if (OptimizerJob.Optimizer is Optimization.Experiment) {
    203211          Optimization.Experiment experiment = OptimizerJob.OptimizerAsExperiment;
     
    211219          batchRun.AlgorithmChanged -= new EventHandler(batchRun_AlgorithmChanged);
    212220        }
    213 
    214221        OptimizerJob.ComputeInParallelChanged -= new EventHandler(OptimizerJob_ComputeInParallelChanged);
    215222        OptimizerJob.ToStringChanged -= new EventHandler(OptimizerJob_ToStringChanged);
     
    285292      this.childHiveJobs.Add(hiveJob);
    286293      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        }
    293302      }
    294303      syncJobsWithOptimizers = true;
     
    305314      bool childIsFinishedOptimizerDownloaded = false;
    306315
    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);
    313319          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        }
    317328      }
    318329
     
    411422
    412423    /// <summary>
    413     /// Creates a SerializedJob object containing the Job and the IJob-Object as byte[]
     424    /// Creates a JobData object containing the Job and the IJob-Object as byte[]
    414425    /// </summary>
    415426    /// <param name="withoutChildOptimizers">
    416427    ///   if true the Child-Optimizers will not be serialized (if the job contains an Experiment)
    417428    /// </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
    419433      byte[] jobByteArray;
    420434      if (withoutChildOptimizers && this.OptimizerJob.Optimizer is Optimization.Experiment) {
     
    435449      UpdateRequiredPlugins();
    436450
    437       JobData serializedJob = new JobData() {
     451      JobData jobData = new JobData() {
    438452        JobId = job.Id,
    439453        Data = jobByteArray
    440454      };
    441455
    442       return serializedJob;
     456      return jobData;
    443457    }
    444458
     
    447461    /// </summary>
    448462    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;
    451487    }
    452488
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/Properties/Settings.Designer.cs

    r4629 r4905  
    1414    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    1515    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
    16     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
     16    public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
    1717       
    1818        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  
    2424
    2525namespace HeuristicLab.Clients.Hive {
    26   internal class ServiceLocator {
     26  public class ServiceLocator {
    2727    private static ServiceLocator instance = null;
    2828    private ServiceClientFactory<IHiveService> serviceFactory = null;
     
    5151      get {
    5252        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");
    5454        }
    5555        return serviceFactory;
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Clients.Hive/3.3/app.config

    r4649 r4905  
    44        <bindings>
    55            <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>
    2213                </binding>
    23             </wsHttpBinding>
    24         </bindings>
     14              </wsHttpBinding>
     15            </bindings>
    2516        <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>
    3221            </endpoint>
    3322        </client>
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Hive.sln

    r4629 r4905  
    2727Project("{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}"
    2828EndProject
     29Project("{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
     49EndProject
     50Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{753CD427-5A39-4B11-8B6D-84D588D65D98}"
     51EndProject
    2952Global
    3053  GlobalSection(SolutionConfigurationPlatforms) = preSolution
    3154    Debug|Any CPU = Debug|Any CPU
     55    Debug|Mixed Platforms = Debug|Mixed Platforms
     56    Debug|x86 = Debug|x86
    3257    Release|Any CPU = Release|Any CPU
     58    Release|Mixed Platforms = Release|Mixed Platforms
     59    Release|x86 = Release|x86
    3360  EndGlobalSection
    3461  GlobalSection(ProjectConfigurationPlatforms) = postSolution
    3562    {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    3663    {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
    3767    {F98A1740-9AC9-4D36-A582-6A2D0D06978D}.Release|Any CPU.ActiveCfg = Release|Any CPU
    3868    {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
    3972    {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    4073    {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
    4177    {989FE92B-484E-41EE-87E2-6A24AF0381D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
    4278    {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
    4382    {14424A16-48D4-445E-80BF-DDF617548BBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    4483    {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
    4587    {14424A16-48D4-445E-80BF-DDF617548BBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
    4688    {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
    4792    {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    4893    {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
    4997    {EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
    5098    {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
    51102    {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    52103    {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
    53107    {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
    54108    {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
    55112    {E1D6C801-892A-406A-B606-F158E36DD3C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    56113    {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
    57117    {E1D6C801-892A-406A-B606-F158E36DD3C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
    58118    {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
    59122    {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    60123    {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
    61127    {8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
    62128    {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
    63132    {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    64133    {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
    65137    {CF9DA321-AC1B-4FD3-9EC3-67BC6B861BDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
    66138    {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
    67163  EndGlobalSection
    68164  GlobalSection(SolutionProperties) = preSolution
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HiveItemBase.cs

    r4796 r4905  
    1010  [DataContract]
    1111  [Serializable]
    12   public abstract class HiveItemBase : DeepCloneable {
     12  public abstract class HiveItemBase : IDeepCloneable {
    1313    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    }
    1523  }
    1624}
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Job.cs

    r4796 r4905  
    4040    [DataMember]
    4141    public Guid? ProjectId { get; set; }
     42    [DataMember]
     43    public List<Guid> PluginsNeededIds { get; set; }
    4244
    4345    public Job() { }
     
    4850      this.MemoryNeeded = original.MemoryNeeded;
    4951      this.ProjectId = original.ProjectId;
     52      this.PluginsNeededIds = new List<Guid>(original.PluginsNeededIds);
    5053    }
    5154    public override IDeepCloneable Clone(Cloner cloner) {
     
    5659      return string.Format("State: {0}, SlaveId: {1}, DateCreated: {2}, DateCalculated: {3}, CoresNeeded: {4}, MemoryNeeded: {5}", JobState, SlaveId, DateCreated, DateCalculated, CoresNeeded, MemoryNeeded);
    5760    }
     61
    5862  }
    5963}
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/HeuristicLab.Services.Hive.Common-3.3.csproj

    r4649 r4905  
    6868    <Compile Include="DataTransfer\HiveItem.cs" />
    6969    <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" />
    7272    <Compile Include="DataTransfer\Job.cs" />
    7373    <Compile Include="DataTransfer\LightweightJob.cs" />
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/MessageContainer.cs

    r4796 r4905  
    3131  [StorableClass]
    3232  [Serializable]
    33   public class MessageContainer : DeepCloneable {
     33  public class MessageContainer : IDeepCloneable {
    3434
    3535    public enum MessageType {
     
    6969      JobId = jobId;
    7070    }
    71     protected MessageContainer(MessageContainer original, Cloner cloner) : base(original, cloner) {
     71    protected MessageContainer(MessageContainer original, Cloner cloner) {
     72      cloner.RegisterClonedObject(original, this);
    7273      this.Message = original.Message;
    7374      this.JobId = original.JobId;
    7475    }
    75     public override IDeepCloneable Clone(Cloner cloner) {
     76    public virtual IDeepCloneable Clone(Cloner cloner) {
    7677      return new MessageContainer(this, cloner);
     78    }
     79    public object Clone() {
     80      return Clone(new Cloner());
    7781    }
    7882  }
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/ServiceContracts/IHiveService.cs

    r4649 r4905  
    1515    #region Job Methods
    1616    [OperationContract]
    17     Guid AddJob(Job jobDto, JobData jobDataDto);
     17    Guid AddJob(Job job, JobData jobData);
    1818
    1919    [OperationContract]
    20     Guid AddChildJob(Guid parentJobId, Job jobDto, JobData jobDataDto);
     20    Guid AddChildJob(Guid parentJobId, Job job, JobData jobData);
    2121
    2222    [OperationContract] // formerly GetJobById
     
    7878
    7979    [OperationContract]
    80     Job PauseJob(JobData serializedJob);
     80    Job PauseJob(Guid jobId);
    8181    #endregion
    8282
     
    138138    #region Plugin Methods
    139139    [OperationContract]
    140     IEnumerable<HivePluginData> GetPlugins(List<HivePlugin> pluginList);
     140    IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds);
    141141    [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);
    143147    #endregion
    144148
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Convert.cs

    r4649 r4905  
    4545        SlaveId = source.SlaveId,
    4646        JobState = source.JobState,
    47         UserId = source.UserId
     47        UserId = source.UserId,
     48        PluginsNeededIds = source.RequiredPlugins.Select(x => x.PluginId).ToList()
    4849      };
    4950    }
     
    6970        target.JobState = source.JobState;
    7071        target.UserId = source.UserId;
     72//        target.RequiredPlugins = db.Plugins.Select(x => source.PluginsNeededIds.Contains(x.PluginId)); - this is difficult
    7173      }
    7274    }
     
    107109    #endregion
    108110
     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
    109145    #region Slave
    110146    public static DT.Slave ToDto(Slave source) {
     
    137173      if ((source != null) && (target != null)) {
    138174        target.ResourceId = source.Id;
    139         target.Name = source.Name; 
     175        target.Name = source.Name;
    140176        //target.SlaveGroup_Resources_Children = // TODO: see how working with groups will work, then decide how to handle enumerations in here
    141177        //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  
    5050      <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
    5151    </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>
    5356    <Reference Include="System" />
    5457    <Reference Include="System.Core" />
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs

    r4649 r4905  
    1111
    1212  public class HiveDao : IHiveDao {
    13     public HiveDataContext CreateContext() {
     13    public static HiveDataContext CreateContext() {
    1414      return new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);
    1515    }
     
    7474    }
    7575
    76     public IEnumerable<DT.Job> GetAvailableJobs(DT.Slave slave) {
     76    public IEnumerable<DT.Job> GetWaitingJobs(DT.Slave slave) {
    7777      using (var db = CreateContext()) {
    7878        var query = from j in db.Jobs
     
    166166    #endregion
    167167
     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
    168249    #region Slave Methods
    169250    public DT.Slave GetSlave(Guid id) {
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml

    r4649 r4905  
    4040      <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
    4141      <Column Name="Version" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
    42       <Column Name="BuildDate" Type="System.String" DbType="VarChar(20)" CanBeNull="false" />
    4342      <Association Name="Plugin_RequiredPlugin" Member="RequiredPlugins" ThisKey="PluginId" OtherKey="PluginId" Type="RequiredPlugin" />
    4443      <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  
    11<?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">
    33  <DataContextMoniker Name="/HiveDataContext" />
    44  <nestedChildShapes>
     
    2727      </nestedChildShapes>
    2828    </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">
    3030      <DataClassMoniker Name="/HiveDataContext/Plugin" />
    3131      <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" />
    3333      </nestedChildShapes>
    3434    </classShape>
     
    189189      </nestedChildShapes>
    190190    </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">
    192192      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
    193193      <nodes>
     
    203203      </nodes>
    204204    </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">
    206206      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" />
    207207      <nodes>
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs

    r4649 r4905  
    907907    private string _Version;
    908908   
    909     private string _BuildDate;
    910    
    911909    private EntitySet<RequiredPlugin> _RequiredPlugins;
    912910   
     
    921919    partial void OnVersionChanging(string value);
    922920    partial void OnVersionChanged();
    923     partial void OnBuildDateChanging(string value);
    924     partial void OnBuildDateChanged();
    925921    #endregion
    926922   
     
    987983          this.SendPropertyChanged("Version");
    988984          this.OnVersionChanged();
    989         }
    990       }
    991     }
    992    
    993     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BuildDate", DbType="VarChar(20)", CanBeNull=false)]
    994     public string BuildDate
    995     {
    996       get
    997       {
    998         return this._BuildDate;
    999       }
    1000       set
    1001       {
    1002         if ((this._BuildDate != value))
    1003         {
    1004           this.OnBuildDateChanging(value);
    1005           this.SendPropertyChanging();
    1006           this._BuildDate = value;
    1007           this.SendPropertyChanged("BuildDate");
    1008           this.OnBuildDateChanged();
    1009985        }
    1010986      }
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs

    r4629 r4905  
    1515    void UpdateJob(DT.Job dto);
    1616    void DeleteJob(Guid id);
    17     IEnumerable<DT.Job> GetAvailableJobs(DT.Slave slave);
     17    IEnumerable<DT.Job> GetWaitingJobs(DT.Slave slave);
    1818    #endregion
    1919
     
    3535
    3636    #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);
    3742    #endregion
    3843
    3944    #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);
    4050    #endregion
    4151
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Tools/CreateHiveDatabaseApplication.cs

    r4649 r4905  
    2727
    2828    public override void Run() {
    29       var dao = new HiveDao();
    30       using (var db = dao.CreateContext()) {
     29      using (var db = HiveDao.CreateContext()) {
    3130        if (db.DatabaseExists())
    3231          db.DeleteDatabase();
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Tools/prepareHiveDatabase.sql

    r4629 r4905  
    3131ALTER TABLE dbo.AssignedResources ALTER COLUMN AssignedRessourcesId ADD ROWGUIDCOL;
    3232ALTER TABLE dbo.AssignedResources WITH NOCHECK ADD CONSTRAINT [DF_AssignedResources_AssignedRessourcesId] DEFAULT (newid()) FOR AssignedRessourcesId;
     33ALTER TABLE [dbo].[AssignedResources]  DROP  CONSTRAINT [Job_AssignedResource]
     34ALTER TABLE [dbo].[AssignedResources]  WITH CHECK ADD  CONSTRAINT [Job_AssignedResource] FOREIGN KEY([JobId])
     35REFERENCES [dbo].[Job] ([JobId])
     36ON UPDATE CASCADE
     37ON DELETE CASCADE
     38GO
     39ALTER TABLE [dbo].[AssignedResources]  DROP  CONSTRAINT [Resource_AssignedResource]
     40ALTER TABLE [dbo].[AssignedResources]  WITH CHECK ADD  CONSTRAINT [Resource_AssignedResource] FOREIGN KEY([ResourceId])
     41REFERENCES [dbo].[Resource] ([ResourceId])
     42ON UPDATE CASCADE
     43ON DELETE CASCADE
     44GO
    3345
    3446ALTER TABLE dbo.Job ALTER COLUMN JobId ADD ROWGUIDCOL;
     
    5062ALTER TABLE dbo.RequiredPlugins WITH NOCHECK ADD CONSTRAINT [DF_RequiredPlugins_RequiredPluginId] DEFAULT (newid()) FOR RequiredPluginId;
    5163
     64ALTER TABLE [dbo].[RequiredPlugins]  DROP  CONSTRAINT [Job_RequiredPlugin]
     65ALTER TABLE [dbo].[RequiredPlugins]  WITH CHECK ADD  CONSTRAINT [Job_RequiredPlugin] FOREIGN KEY([JobId])
     66REFERENCES [dbo].[Job] ([JobId])
     67ON UPDATE CASCADE
     68ON DELETE CASCADE
     69GO
     70
     71ALTER TABLE [dbo].[RequiredPlugins]  DROP  CONSTRAINT [Plugin_RequiredPlugin]
     72ALTER TABLE [dbo].[RequiredPlugins]  WITH CHECK ADD  CONSTRAINT [Plugin_RequiredPlugin] FOREIGN KEY([PluginId])
     73REFERENCES [dbo].[Plugin] ([PluginId])
     74ON UPDATE CASCADE
     75ON DELETE CASCADE
     76GO
     77
    5278ALTER TABLE dbo.Resource ALTER COLUMN ResourceId ADD ROWGUIDCOL;
    5379ALTER TABLE dbo.Resource WITH NOCHECK ADD CONSTRAINT [DF_Resource_ResourceId] DEFAULT (newid()) FOR ResourceId;
     
    6490/* create indices */
    6591CREATE INDEX Index_RequiredPlugins_JobId ON RequiredPlugins(JobId);
     92
     93/* triggers */
     94SET ANSI_NULLS ON
     95GO
     96SET QUOTED_IDENTIFIER ON
     97GO
     98-- =============================================
     99-- Author:    cneumuel
     100-- Create date: 11.11.2010
     101-- Description: Deletes the root-job of the experiment when experiment is deleted
     102-- =============================================
     103CREATE TRIGGER [dbo].[tr_HiveExperimentDeleteCascade] ON [dbo].[HiveExperiment] FOR DELETE AS
     104SET NOCOUNT ON
     105DELETE Job FROM deleted, Job WHERE Job.JobId = deleted.RootJobId
     106GO
     107
     108SET ANSI_NULLS ON
     109GO
     110SET QUOTED_IDENTIFIER ON
     111GO
     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-- =============================================
     117CREATE TRIGGER [dbo].[tr_JobDeleteCascade] ON [dbo].[Job] INSTEAD OF DELETE AS
     118BEGIN
     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
     140END
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/MergeConfigs.cmd

    r4649 r4905  
    33%SolutionDir%ConfigMerger "%SolutionDir%HeuristicLab.Services.Hive\3.3\app.config" "%TargetDir%HeuristicLab.Hive-3.3.dll.config"
    44%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"
    56
    67copy "%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  
    126126  <ItemGroup>
    127127    <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>
    129131    <None Include="app.config" />
    130132    <None Include="HeuristicLab.snk" />
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/app.config

    r4810 r4905  
    1919      </netTcpBinding>
    2020      <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"/>
    2323          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
    2424          <security mode="Message">
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/PluginCache.cs

    r4810 r4905  
    139139        Logger.Debug("creating new files");
    140140        foreach (HivePluginFile pf in updateablePlugin.PluginFiles) {
    141           string x = PluginRepositoryDir + pf.Name.Split('\\').Last();
    142           string y = Path.Combine(PluginRepositoryDir, Path.GetFileName(pf.Name));
    143141          File.WriteAllBytes(Path.Combine(PluginRepositoryDir, Path.GetFileName(pf.Name)), pf.BinaryFile);
    144142        }
Note: See TracChangeset for help on using the changeset viewer.