Changeset 5153


Ignore:
Timestamp:
12/21/10 18:16:24 (10 years ago)
Author:
cneumuel
Message:

#1260

  • increased timeouts for sent jobs (which are needed if the jobs take long time to deserialize on slave)
  • added DeleteJob to ClientService
  • made optimizer actually Pause instead of Stop when stop is called explicitly (so they can be resumed later)
  • temporarily disabled job-abortion from server because it aborted jobs which took too long to deserialize on slaves (this issue needs to be investigated)
  • reduced locking of engines on slave so that the deserialization does not block heartbeats

#1347

  • worked on HiveEngine
  • added test project for HiveEngine
Location:
branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive
Files:
18 added
23 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive 3.3.sln

    r5135 r5153  
    7676Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Hive.Slave.ExecutionEngine-3.3", "HeuristicLab.Hive.Slave.ExecutionEngine\3.3\HeuristicLab.Hive.Slave.ExecutionEngine-3.3.csproj", "{1605256A-1CB3-44AB-AAFF-577093EE5789}"
    7777EndProject
    78 Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Hive-3.3", "HiveWeb\Hive-3.3", "{590AD383-846B-48FF-8D06-B0AA1B328102}"
     78Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Hive-3.3", "HiveWeb\Hive-3.3\", "{590AD383-846B-48FF-8D06-B0AA1B328102}"
    7979  ProjectSection(WebsiteProperties) = preProject
    8080    TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
     
    102102EndProject
    103103Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.HiveEngine-3.3", "HeuristicLab.HiveEngine\3.3\HeuristicLab.HiveEngine-3.3.csproj", "{59BC6F3B-82E9-4E1A-A7FF-D467A98F759B}"
     104EndProject
     105Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.HiveEngineTest", "HeuristicLab.HiveEngineTest\HeuristicLab.HiveEngineTest.csproj", "{8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}"
    104106EndProject
    105107Global
     
    422424    {59BC6F3B-82E9-4E1A-A7FF-D467A98F759B}.Release|x64.ActiveCfg = Release|Any CPU
    423425    {59BC6F3B-82E9-4E1A-A7FF-D467A98F759B}.Release|x86.ActiveCfg = Release|Any CPU
     426    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     427    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Debug|Any CPU.Build.0 = Debug|Any CPU
     428    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
     429    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Debug|Mixed Platforms.Build.0 = Debug|x86
     430    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Debug|x64.ActiveCfg = Debug|x86
     431    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Debug|x86.ActiveCfg = Debug|x86
     432    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Debug|x86.Build.0 = Debug|x86
     433    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Release|Any CPU.ActiveCfg = Release|Any CPU
     434    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Release|Any CPU.Build.0 = Release|Any CPU
     435    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Release|Mixed Platforms.ActiveCfg = Release|x86
     436    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Release|Mixed Platforms.Build.0 = Release|x86
     437    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Release|x64.ActiveCfg = Release|x86
     438    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Release|x86.ActiveCfg = Release|x86
     439    {8BF04DE6-9022-4DD0-BBF6-1A3623F9463A}.Release|x86.Build.0 = Release|x86
    424440  EndGlobalSection
    425441  GlobalSection(SolutionProperties) = preSolution
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/ApplicationConstants.cs

    r5093 r5153  
    3333    public static System.Transactions.IsolationLevel ISOLATION_LEVEL_SCOPE = System.Transactions.IsolationLevel.ReadCommitted;
    3434
    35     public static int HEARTBEAT_MAX_DIF = 120; // value in seconds
     35    public static int HEARTBEAT_MAX_DIF = 1200; // value in seconds
    3636   
    37     public static int JOB_TIME_TO_LIVE = 20;
     37    public static int JOB_TIME_TO_LIVE = 900; // heartbeats from the assigned slave
    3838
    3939    /// <summary>
     
    4545    /// Maximum number of jobs that the server should send/receive simultaniously
    4646    /// </summary>
    47     public static int MAX_JOB_TRANSFER_COUNT = 6;
     47    public static int MAX_JOB_TRANSFER_COUNT = 8;
    4848
    4949    /// <summary>
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/Interfaces/IClientFacade.cs

    r4424 r5153  
    6262    [OperationContract]
    6363    ResponseObject<JobDto> AddChildJob(Guid parentJobId, SerializedJob serializedJob);
     64
     65    [OperationContract]
     66    Response DeleteJob(Guid jobId);
    6467  }
    6568}
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/Interfaces/IJobManager.cs

    r4424 r5153  
    107107    [OperationContract]
    108108    Response DeleteChildJobs(Guid jobId);
     109
     110    [OperationContract]
     111    Response DeleteJob(Guid jobId);
    109112  }
    110113}
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/ResponseStatus.cs

    r4424 r5153  
    8181    DeleteHiveExperiment_Failed,
    8282    DeleteChildJobs_Failed,
     83    DeleteJob_Failed,
    8384  }
    8485}
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/WcfServicePool.cs

    r4914 r5153  
    4444    public string Password {
    4545      get { return password; }
    46       set { hostAddress = value; }
     46      set { password = value; }
    4747    }
    4848
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3/Jobs/OptimizerJob.cs

    r5132 r5153  
    158158
    159159    public virtual void Stop() {
    160       optimizer.Stop();
     160      optimizer.Pause();
    161161    }
    162162
     
    167167    public event EventHandler JobStopped;
    168168    protected virtual void OnJobStopped() {
    169       optimizer.Prepare(); // nuke executioncontext and scopes to reduce memory footprint
    170169      EventHandler handler = JobStopped;
    171170      if (handler != null) handler(this, EventArgs.Empty);
     
    212211    protected virtual void RegisterEvents() {
    213212      optimizer.Stopped += new EventHandler(optimizer_Stopped);
     213      optimizer.Paused += new EventHandler(optimizer_Paused);
    214214      optimizer.ExceptionOccurred += new EventHandler<Common.EventArgs<Exception>>(optimizer_ExceptionOccurred);
    215215      optimizer.DescriptionChanged += new EventHandler(optimizer_DescriptionChanged);
     
    219219      optimizer.ToStringChanged += new EventHandler(optimizer_ToStringChanged);
    220220    }
     221
    221222    protected virtual void DeregisterEvents() {
    222223      optimizer.Stopped -= new EventHandler(optimizer_Stopped);
     224      optimizer.Paused -= new EventHandler(optimizer_Paused);
    223225      optimizer.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(optimizer_ExceptionOccurred);
    224226      optimizer.DescriptionChanged -= this.DescriptionChanged;
     
    256258      OnJobStopped();
    257259    }
     260
     261    void optimizer_Paused(object sender, EventArgs e) {
     262      OnJobStopped();
     263    }
    258264    #endregion
    259265
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3/ServiceLocator.cs

    r4914 r5153  
    2424
    2525namespace HeuristicLab.Hive.ExperimentManager {
    26   internal class ServiceLocator {
     26  public class ServiceLocator {
    2727    private static ServiceLocator instance = null;
    2828    private WcfServicePool<IClientFacade> clientFacadePool = null;
    2929    private WcfServicePool<IClientFacade> streamedClientFacadePool = null;
    3030
    31     internal static ServiceLocator Instance {
     31    public static ServiceLocator Instance {
    3232      get {
    3333        if (instance == null) {
     
    4040    public ServiceLocator() {  }
    4141
    42     internal WcfServicePool<IClientFacade> ClientFacadePool {
     42    public WcfServicePool<IClientFacade> ClientFacadePool {
    4343      get {
    4444        if (clientFacadePool == null) {
     
    4949    }
    5050
    51     internal WcfServicePool<IClientFacade> StreamedClientFacadePool {
     51    public WcfServicePool<IClientFacade> StreamedClientFacadePool {
    5252      get {
    5353        if (streamedClientFacadePool == null) {
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3/app.config

    r5134 r5153  
    2929    </bindings>
    3030    <client>
    31       <endpoint address="net.tcp://f005pc.hagenberg.fhooe.at:9001/Hive-3.3/ClientService.svc" binding="netTcpBinding" bindingConfiguration="ClientTcpStreamedEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IClientFacade" name="ClientTcpStreamedEndpoint">
     31      <endpoint address="net.tcp://services.heuristiclab.com:8000/Hive-3.3/ClientService.svc" binding="netTcpBinding" bindingConfiguration="ClientTcpStreamedEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IClientFacade" name="ClientTcpStreamedEndpoint">
    3232        <identity>
    33           <dns value="localhost"/>
     33          <dns value="services.heuristiclab.com"/>
    3434        </identity>
    3535      </endpoint>
    36       <endpoint address="http://f005pc.hagenberg.fhooe.at:9000/Hive-3.3/ClientService.svc" binding="wsHttpBinding" bindingConfiguration="ClientHttpEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IClientFacade" name="ClientHttpEndpoint">
     36      <endpoint address="http://services.heuristiclab.com/Hive-3.3/ClientService.svc" binding="wsHttpBinding" bindingConfiguration="ClientHttpEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IClientFacade" name="ClientHttpEndpoint">
    3737        <identity>
    38           <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac="/>
     38          <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ=="/>
    3939        </identity>
    4040      </endpoint>
    4141    </client>
    42 
     42   
    4343  </system.serviceModel>
    4444<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.JobBase/3.3/HeuristicLab.Hive.JobBase-3.3.csproj

    r5054 r5153  
    9292  </PropertyGroup>
    9393  <ItemGroup>
    94     <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    95     <Reference Include="HeuristicLab.Core-3.3">
    96       <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
     94    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     95      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
    9796    </Reference>
    98     <Reference Include="HeuristicLab.Persistence-3.3">
    99       <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
     97    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     98      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
    10099    </Reference>
    101     <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
    102       <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     100    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     101      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
     102    </Reference>
     103    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     104      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
    103105    </Reference>
    104106    <Reference Include="System" />
     
    106108      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    107109    </Reference>
     110    <Reference Include="System.Drawing" />
    108111    <Reference Include="System.Xml.Linq">
    109112      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     
    119122    <Compile Include="Interfaces\IJob.cs" />
    120123    <Compile Include="HeuristicLabHiveJobBasePlugin.cs" />
     124    <Compile Include="AbstractJob.cs" />
    121125    <Compile Include="PluginUtil.cs" />
    122126    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Console/3.3/app.config

    r5134 r5153  
    2626    </bindings>
    2727    <client>
    28       <endpoint address="http://f005pc.hagenberg.fhooe.at:9000/Hive-3.3/ServerConsoleService.svc" behaviorConfiguration="ServerConsoleBehaviour" binding="wsHttpBinding" bindingConfiguration="ServerConsoleHttpEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IServerConsoleFacade" name="ServerConsoleHttpEndpoint">
     28      <endpoint address="http://services.heuristiclab.com/Hive-3.3/ServerConsoleService.svc" behaviorConfiguration="ServerConsoleBehaviour" binding="wsHttpBinding" bindingConfiguration="ServerConsoleHttpEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IServerConsoleFacade" name="ServerConsoleHttpEndpoint">
    2929        <identity>
    30           <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac="/>
     30          <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ=="/>
    3131        </identity>
    3232      </endpoint>
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ClientFacade.cs

    r4755 r5153  
    158158    [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)]
    159159    [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.User)]
     160    public Response DeleteJob(Guid jobId) {
     161      using (contextFactory.GetContext()) {
     162        var jobDto = DaoLocator.JobDao.FindById(jobId);
     163        if (jobId != null) {
     164          ServiceLocator.GetAuthorizationManager().Authorize(jobDto.UserId);
     165        }
     166        return jobManager.DeleteJob(jobId);
     167      }
     168    }
     169
     170    [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)]
     171    [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.User)]
    160172    public ResponseObject<JobDto> AddChildJob(Guid parentJobId, SerializedJob serializedJob) {
    161173      using (contextFactory.GetContext()) {
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ServerConsoleFacade.cs

    r4424 r5153  
    279279    }
    280280
     281    [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)]
     282    public Response DeleteJob(Guid jobId) {
     283      using (contextFactory.GetContext()) {
     284        return jobManager.DeleteJob(jobId);
     285      }
     286    }
    281287  }
    282288}
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/JobManager.cs

    r5093 r5153  
    433433    }
    434434
     435    public Response DeleteJob(Guid jobId) {
     436      Response response = new Response();
     437      try {
     438        DaoLocator.JobDao.Delete(jobId);
     439      }
     440      catch (Exception) {
     441        response.StatusMessage = ResponseStatus.DeleteJob_Failed;
     442      }
     443      return response;
     444    }
     445
    435446    #endregion
    436447
     
    462473    #endregion
    463474
    464 
    465475  }
    466476}
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/SlaveCommunicator.cs

    r5132 r5153  
    318318          // job does not exist in db
    319319          Logger.Error("Job does not exist in DB: " + jobProgress.Key);
    320           actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, jobProgress.Key));
     320          //actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, jobProgress.Key));
    321321        } else {
    322322          curJob.Slave = DaoLocator.SlaveDao.GetSlaveForJob(curJob.Id);
     
    325325            // assigned slave does not match heartbeat
    326326            Logger.Error("The slave " + heartbeatData.SlaveId + " is not supposed to calculate Job: " + curJob.ToString());
    327             actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id));
     327            //actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id));
    328328          } else {
    329329            // save job execution time
     
    333333              // a request to abort the job has been set
    334334              Logger.Error("Job is in state aborted, send AbortJob: " + curJob.Id);
    335               actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id));
     335              //actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id));
    336336            } else if (curJob.State == JobState.SnapshotRequested) {
    337337              // a request for a snapshot has been set
     
    364364                DaoLocator.JobDao.Update(currJob);
    365365
    366                 actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, currJob.Id));
     366                //actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, currJob.Id));
    367367
    368368                lifecycleManager.NewAssignedJobs.Remove(currJob.Id);
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/HeuristicLab.Hive.Slave.Communication-3.3.csproj

    r5132 r5153  
    111111  </ItemGroup>
    112112  <ItemGroup>
    113     <None Include="app.config">
    114       <SubType>Designer</SubType>
    115     </None>
     113    <None Include="app.config" />
    116114    <None Include="f005pc.hagenberg.fhooe.at - app.config">
    117115      <SubType>Designer</SubType>
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/app.config

    r5134 r5153  
    2727    </bindings>
    2828    <client>
    29       <endpoint address="http://f005pc.hagenberg.fhooe.at:9000/Hive-3.3/SlaveService.svc" binding="wsHttpBinding" bindingConfiguration="SlaveHttpEndpoint" contract="SlaveFacade.ISlaveFacade" name="SlaveHttpEndpoint">
     29      <endpoint address="http://services.heuristiclab.com/Hive-3.3/SlaveService.svc" binding="wsHttpBinding" bindingConfiguration="SlaveHttpEndpoint" contract="SlaveFacade.ISlaveFacade" name="SlaveHttpEndpoint">
    3030        <identity>
    31           <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac=" />
     31          <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ=="/>
    3232        </identity>
    3333      </endpoint>
    34       <endpoint address="net.tcp://f005pc.hagenberg.fhooe.at:9001/Hive-3.3/SlaveService.svc" binding="netTcpBinding" bindingConfiguration="SlaveTcpStreamedEndpoint" contract="SlaveFacade.ISlaveFacade" name="SlaveTcpStreamedEndpoint">
     34      <endpoint address="net.tcp://services.heuristiclab.com:8000/Hive-3.3/SlaveService.svc" binding="netTcpBinding" bindingConfiguration="SlaveTcpStreamedEndpoint" contract="SlaveFacade.ISlaveFacade" name="SlaveTcpStreamedEndpoint">
    3535        <identity>
    36           <dns value="localhost"/>
     36          <dns value="services.heuristiclab.com"/>
    3737        </identity>
    3838      </endpoint>
    3939    </client>
    4040  </system.serviceModel>
    41 <startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
     41  <startup>
     42    <supportedRuntime version="v2.0.50727"/>
     43  </startup>
     44</configuration>
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Console/3.3/app.config

    r5093 r5153  
    1616    <bindings>
    1717      <netTcpBinding>
    18         <binding name="SlaveConsoleTcpEndpointBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="104857600" maxBufferSize="104857600" maxReceivedMessageSize="104857600">
     18        <binding name="SlaveConsoleTcpEndpointBinding" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="104857600" maxBufferSize="104857600" maxReceivedMessageSize="104857600">
    1919          <readerQuotas maxDepth="320" maxStringContentLength="104857600" maxArrayLength="104857600" maxBytesPerRead="104857600" maxNameTableCharCount="104857600"/>
    2020          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/Core.cs

    r5093 r5153  
    141141            catch (AppDomainUnloadedException) {
    142142              // appdomain already unloaded. Finishing job probably ongoing
    143             }
    144           else
     143            } else
    145144            Logger.Error("AbortJob: Engine doesn't exist");
    146145          break;
     
    291290
    292291        byte[] sJob = engines[jId].GetFinishedJob();
    293        
     292
    294293        try {
    295294          Logger.Info("Sending the finished job with id: " + jId);
     
    384383            AppDomain appDomain = HeuristicLab.PluginInfrastructure.Sandboxing.SandboxManager.CreateAndInitSandbox(e.Result.Obj.Id.ToString(), pluginDir, Path.Combine(pluginDir, PluginCache.ConfigFileName));
    385384            appDomain.UnhandledException += new UnhandledExceptionEventHandler(appDomain_UnhandledException);
    386             lock (engines) {
    387               if (!jobs.ContainsKey(e.Result.Obj.Id)) {
    388                 jobs.Add(e.Result.Obj.Id, e.Result.Obj);
    389                 appDomains.Add(e.Result.Obj.Id, appDomain);
    390                 Logger.Debug("Creating AppDomain");
    391                 Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName);
     385
     386            if (!jobs.ContainsKey(e.Result.Obj.Id)) {
     387              jobs.Add(e.Result.Obj.Id, e.Result.Obj);
     388              appDomains.Add(e.Result.Obj.Id, appDomain);
     389              Logger.Debug("Creating AppDomain");
     390
     391              Executor engine;
     392              lock (engines) {
     393                engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName);
    392394                Logger.Debug("Created AppDomain");
    393395                engine.JobId = e.Result.Obj.Id;
     
    395397                Logger.Debug("Starting Engine for job " + e.Result.Obj.Id);
    396398                engines.Add(e.Result.Obj.Id, engine);
    397                 engine.Start(e.Data);
    398                 SlaveStatusInfo.JobsFetched++;
    399                 Logger.Info("Increment FetchedJobs to:" + SlaveStatusInfo.JobsFetched);
    400399              }
     400              SlaveStatusInfo.JobsFetched++;
     401              Logger.Info("Increment FetchedJobs to:" + SlaveStatusInfo.JobsFetched);
     402              engine.Start(e.Data);
    401403            }
    402404            heartbeatManager.AwakeHeartBeatThread();
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.ExecutionEngine/3.3/Executor.cs

    r5000 r5153  
    7979          ));
    8080        } else {
    81           Job.Prepare();
     81          if(Job.ExecutionState == Core.ExecutionState.Stopped)
     82            Job.Prepare();
     83         
    8284          Job.Start();
    8385        }
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive/3.3/Files.txt

    r4932 r5153  
    2525
    2626HeuristicLab.Hive.Tracing\3.3:HeuristicLab.Hive.Tracing-3.3.dll
     27
     28HeuristicLab.HiveEngine\3.3:HeuristicLab.HiveEngine-3.3.dll
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.HiveEngine/3.3/HeuristicLab.HiveEngine-3.3.csproj

    r5136 r5153  
    3232    <WarningLevel>4</WarningLevel>
    3333  </PropertyGroup>
     34  <PropertyGroup>
     35    <SignAssembly>true</SignAssembly>
     36  </PropertyGroup>
     37  <PropertyGroup>
     38    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
     39  </PropertyGroup>
    3440  <ItemGroup>
    3541    <Reference Include="HeuristicLab.Clients.Common-3.3">
     
    4854      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
    4955    </Reference>
     56    <Reference Include="HeuristicLab.Core.Views-3.3">
     57      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Core.Views-3.3.dll</HintPath>
     58    </Reference>
     59    <Reference Include="HeuristicLab.MainForm-3.3">
     60      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm-3.3.dll</HintPath>
     61    </Reference>
     62    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
     63      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
     64    </Reference>
     65    <Reference Include="HeuristicLab.Optimization.Views-3.3">
     66      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization.Views-3.3.dll</HintPath>
     67    </Reference>
    5068    <Reference Include="HeuristicLab.Persistence-3.3">
    5169      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
     
    5371    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
    5472      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     73    </Reference>
     74    <Reference Include="HeuristicLab.Random-3.3">
     75      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Random-3.3.dll</HintPath>
    5576    </Reference>
    5677    <Reference Include="HeuristicLab.SequentialEngine-3.3">
     
    6081    <Reference Include="System.Core" />
    6182    <Reference Include="System.Drawing" />
     83    <Reference Include="System.Windows.Forms" />
    6284    <Reference Include="System.Xml.Linq" />
    6385    <Reference Include="System.Data.DataSetExtensions" />
     
    6789  <ItemGroup>
    6890    <Compile Include="ScopeMergeException.cs" />
     91    <Compile Include="Views\HiveEngineView.cs">
     92      <SubType>UserControl</SubType>
     93    </Compile>
     94    <Compile Include="Views\HiveEngineView.Designer.cs">
     95      <DependentUpon>HiveEngineView.cs</DependentUpon>
     96    </Compile>
     97    <None Include="HeuristicLab.snk" />
    6998    <None Include="Properties\AssemblyInfo.cs.frame" />
    7099    <None Include="HeuristicLabHiveEnginePlugin.cs.frame" />
     
    92121    </ProjectReference>
    93122  </ItemGroup>
     123  <ItemGroup>
     124    <EmbeddedResource Include="Views\HiveEngineView.resx">
     125      <DependentUpon>HiveEngineView.cs</DependentUpon>
     126    </EmbeddedResource>
     127  </ItemGroup>
    94128  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    95129  <PropertyGroup>
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.HiveEngine/3.3/HiveEngine.cs

    r5136 r5153  
    1313using HeuristicLab.Hive.Contracts.ResponseObjects;
    1414using System.Threading;
     15using HeuristicLab.Random;
    1516
    1617namespace HeuristicLab.HiveEngine {
     
    1920  /// </summary>
    2021  [StorableClass]
    21   [Item("Hive Parallel Engine", "Engine for parallel execution on the hive.")]
     22  [Item("Hive Engine", "Engine for parallel execution on the hive. You need enable `Parallel` for at least one operator in your operator graph to have all childoperations parallelized. Also those childoperations must not have sideeffects on a higher scope.")]
    2223  public class HiveEngine : Engine {
     24    [Storable]
    2325    private IOperator currentOperator;
    2426
     27    [Storable]
     28    public string ResourceIds { get; set; }
     29
    2530    #region constructors and cloning
    26     public HiveEngine() { }
     31    public HiveEngine() {
     32      ResourceIds = "HEAL";
     33    }
    2734    [StorableConstructor]
    2835    protected HiveEngine(bool deserializing) : base(deserializing) { }
    2936    protected HiveEngine(HiveEngine original, Cloner cloner)
    3037      : base(original, cloner) {
     38      this.ResourceIds = original.ResourceIds;
     39      this.currentOperator = cloner.Clone(original.currentOperator);
    3140    }
    3241    public override IDeepCloneable Clone(Cloner cloner) {
     
    4251      while (coll != null) {
    4352        if (coll.Parallel) {
    44           IScope scope = ((IAtomicOperation)coll.Where(x => x is IAtomicOperation).First()).Scope;
    45           IEnumerable<IOperation> finishedOperations = ExecuteOnHive(coll.Select(op => new OperationJob(op)));
    46           foreach (IOperation op in finishedOperations) {
    47             ReIntegrateScope(scope, op);
     53          IDictionary<IOperation, OperationJob> jobs = new Dictionary<IOperation, OperationJob>();
     54          foreach (IOperation op in coll) {
     55            jobs.Add(op, new OperationJob(op));
     56          }
     57
     58          ExecuteOnHive(jobs);
     59
     60          foreach (var kvp in jobs) {
     61            if (kvp.Key is IAtomicOperation) {
     62              ReIntegrateScope(kvp.Value.Operation as IAtomicOperation, kvp.Key as IAtomicOperation);
     63            } else if (kvp.Key is OperationCollection) {
     64              // todo
     65            }
    4866          }
    4967        } else {
     
    7391    }
    7492
    75     private static void ReIntegrateScope(IScope scope, IOperation operation) {
    76       if (operation is IAtomicOperation) {
    77         MergeScopes(scope, ((IAtomicOperation)operation).Scope);
    78       } else if (operation is OperationCollection) {
    79         foreach (IOperation op in (OperationCollection)operation) {
    80           ReIntegrateScope(scope, op);
     93    private IRandom FindRandomParameter(IExecutionContext ec) {
     94      try {
     95        if (ec == null)
     96          return null;
     97
     98        foreach (var p in ec.Parameters) {
     99          if (p.Name == "Random" && p is IValueParameter)
     100            return ((IValueParameter)p).Value as IRandom;
    81101        }
     102        return FindRandomParameter(ec.Parent);
    82103      }
     104      catch { return null; }
    83105    }
    84106
    85     private static void MergeScopes(IScope target, IScope source) {
    86       foreach (IVariable variable in source.Variables) {
    87         if (target.Variables.ContainsKey(variable.Name)) {
    88           if (target.Variables[variable.Name] != source.Variables[variable.Name]) {
    89             // problem: ResultCollection are not equal altough they contain the same values.
    90             //             - either implement ResultCollection.Equals, or consider ResultCollection as special case here
    91             //throw new ScopeMergeException(string.Format("Variable {0} already exists in target scope and has a different value ({1}, {2}).", variable.Name, target.Variables[variable.Name].Value, variable.Value));
    92           }
    93         } else {
    94           target.Variables.Add(variable);
    95         }
    96       }
    97 
    98       //this is not useful on the parentscope of the initial scope
    99       //foreach (IScope subScope in source.SubScopes) {
    100       //  target.SubScopes.Add(subScope);
    101       //}
    102 
    103       if (target.Parent != null && source.Parent != null)
    104         MergeScopes(target.Parent, source.Parent);
     107    private static void ReIntegrateScope(IAtomicOperation source, IAtomicOperation target) {
     108      ExchangeScope(source.Scope, target.Scope);
    105109    }
    106110
    107 
    108     private IEnumerable<IOperation> TestExecuteOnHive(IEnumerable<OperationJob> operationJobs) {
    109       //var clonedJobs = operationJobs.Select(x => (OperationJob)x.Clone()).ToArray();
    110       var results = new List<IOperation>();
    111 
    112       foreach (var job in operationJobs) {
    113         job.Start();
    114         while (job.ExecutionState != Core.ExecutionState.Stopped) {
    115           Thread.Sleep(100);
    116         }
    117         results.Add(job.Operation);
    118       }
    119       return results;
     111    private static void ExchangeScope(IScope source, IScope target) {
     112      target.Variables.Clear();
     113      target.Variables.AddRange(source.Variables);
     114      target.SubScopes.Clear();
     115      target.SubScopes.AddRange(source.SubScopes);
     116      // TODO: validate if parent scopes match - otherwise source is invalid
    120117    }
    121118
    122     private IEnumerable<IOperation> ExecuteOnHive(IEnumerable<OperationJob> operationJobs) {
    123       IEnumerable<Guid> jobIds;
     119    /// <summary>
     120    /// This method blocks until all jobs are finished
     121    /// </summary>
     122    /// <param name="jobDict"></param>
     123    private void ExecuteOnHive(IDictionary<IOperation, OperationJob> jobDict) {
     124      Log.LogMessage(string.Format("Executing {0} operations on the hive.", jobDict.Count));
     125      IDictionary<Guid, IOperation> jobIds = new Dictionary<Guid, IOperation>();
    124126      JobResultList results;
    125 
    126127
    127128      using (Disposable<IClientFacade> service = ServiceLocator.Instance.StreamedClientFacadePool.GetService()) {
    128129        List<JobDto> jobs = new List<JobDto>();
    129         foreach (OperationJob operationJob in operationJobs) {
    130           var groups = new string[] { "HEAL" };
     130        foreach (var kvp in jobDict) {
     131          // shuffle random variable to avoid the same random sequence in each operation
     132          IRandom random = FindRandomParameter(kvp.Key as IExecutionContext);
     133          if (random != null)
     134            random.Reset(random.Next());
     135
     136          var groups = ResourceIds.Split(';');
    131137          SerializedJob serializedJob = new SerializedJob();
    132           serializedJob.SerializedJobData = SerializedJob.Serialize(operationJob);
     138          serializedJob.SerializedJobData = SerializedJob.Serialize(kvp.Value);
    133139          serializedJob.JobInfo = new JobDto();
    134140          serializedJob.JobInfo.State = JobState.Offline;
     
    137143          ResponseObject<JobDto> response = service.Obj.AddJobWithGroupStrings(serializedJob, groups);
    138144          jobs.Add(response.Obj);
     145          jobIds.Add(response.Obj.Id, kvp.Key);
    139146        }
    140         jobIds = jobs.Select(x => x.Id);
    141         results = service.Obj.GetJobResults(jobIds).Obj;
     147        results = service.Obj.GetJobResults(jobIds.Keys).Obj;
    142148      }
    143149
     
    148154        Thread.Sleep(5000);
    149155        using (Disposable<IClientFacade> service = ServiceLocator.Instance.StreamedClientFacadePool.GetService()) {
    150           results = service.Obj.GetJobResults(jobIds).Obj;
     156          results = service.Obj.GetJobResults(jobIds.Keys).Obj;
    151157        }
    152158      }
    153159
    154160      // all finished
    155       List<OperationJob> finishedJobs = new List<OperationJob>();
    156161      using (Disposable<IClientFacade> service = ServiceLocator.Instance.StreamedClientFacadePool.GetService()) {
    157         foreach (Guid jobId in jobIds) {
     162        foreach (Guid jobId in jobIds.Keys) {
    158163          SerializedJob serializedJob = service.Obj.GetLastSerializedResult(jobId).Obj;
    159164          OperationJob operationJob = SerializedJob.Deserialize<OperationJob>(serializedJob.SerializedJobData);
    160           finishedJobs.Add(operationJob);
     165          jobDict[jobIds[jobId]] = operationJob;
    161166        }
    162167      }
    163168
    164169      // delete jobs
    165       // TODO
     170      using (Disposable<IClientFacade> service = ServiceLocator.Instance.StreamedClientFacadePool.GetService()) {
     171        foreach (Guid jobId in jobIds.Keys) {
     172          service.Obj.DeleteJob(jobId);
     173        }
     174      }
    166175
    167       return finishedJobs.Select(x => x.Operation);
     176      Log.LogMessage(string.Format("Operations on the hive finished.", jobDict.Count));
    168177    }
    169178
     
    176185      if (currentOperator != null) currentOperator.Abort();
    177186    }
     187
    178188  }
    179189}
Note: See TracChangeset for help on using the changeset viewer.