Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4333 for branches


Ignore:
Timestamp:
08/27/10 08:35:43 (14 years ago)
Author:
cneumuel
Message:

added authorizationManager which checks for permission to specific jobs (#1168)

Location:
branches/3.3-HiveMigration
Files:
6 added
2 deleted
28 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Calendar/3.3/Properties/AssemblyInfo.cs

    r4320 r4333  
    5858// [assembly: AssemblyVersion("1.0.*")]
    5959[assembly: AssemblyVersion("3.3.0.0")]
    60 [assembly: AssemblyFileVersion("3.3.0.4316")]
     60[assembly: AssemblyFileVersion("3.3.0.4320")]
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/JobDto.cs

    r4267 r4333  
    4141    [Storable]
    4242    [DataMember]
    43     public Guid UserId { get; set; }
     43    public string UserId { get; set; }
    4444    [Storable]
    4545    [DataMember]
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/HiveExperimentView.cs

    r4305 r4333  
    122122        Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e);
    123123      else
    124         startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;
     124        SetEnabledStateOfExecutableButtons();
    125125    }
    126126    private void Content_Prepared(object sender, EventArgs e) {
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HiveExperiment.cs

    r4316 r4333  
    6767    private Semaphore fetchJobSemaphore = new Semaphore(2, 2);
    6868
     69    private static object pendingOptimizerMappingsLocker = new object();
     70
    6971    private bool stopResultsPollingPending = false;
    7072
     
    197199      clone.pendingOptimizersByJobId = new Dictionary<Guid, IOptimizer>();
    198200
    199       foreach (var pair in this.pendingOptimizersByJobId)
    200         clone.pendingOptimizersByJobId[pair.Key] = (IOptimizer)cloner.Clone(pair.Value);
    201 
    202       foreach (var pair in this.parentOptimizersByPendingOptimizer)
    203         clone.parentOptimizersByPendingOptimizer[(IOptimizer)cloner.Clone(pair.Key)] = (IOptimizer)cloner.Clone(pair.Value);
    204 
     201      lock (pendingOptimizerMappingsLocker) {
     202        foreach (var pair in this.pendingOptimizersByJobId)
     203          clone.pendingOptimizersByJobId[pair.Key] = (IOptimizer)cloner.Clone(pair.Value);
     204
     205        foreach (var pair in this.parentOptimizersByPendingOptimizer)
     206          clone.parentOptimizersByPendingOptimizer[(IOptimizer)cloner.Clone(pair.Key)] = (IOptimizer)cloner.Clone(pair.Value);
     207      }
    205208      clone.log = (ILog)cloner.Clone(log);
    206209      clone.stopPending = this.stopPending;
     
    243246      if (experiment != null) {
    244247        StopResultPolling();
    245         lock (pendingOptimizersByJobId) {
     248        lock (pendingOptimizerMappingsLocker) {
    246249          pendingOptimizersByJobId.Clear();
    247         }
    248         parentOptimizersByPendingOptimizer.Clear();
     250          parentOptimizersByPendingOptimizer.Clear();
     251        }
    249252        lock (jobItems) {
    250253          jobItems.Clear();
     
    275278
    276279          IEnumerable<string> groups = ResourceGroups;
    277 
    278           foreach (IOptimizer optimizer in parentOptimizersByPendingOptimizer.Keys) {
    279             SerializedJob serializedJob = CreateSerializedJob(optimizer);
    280             ResponseObject<JobDto> response = clientFacade.AddJobWithGroupStrings(serializedJob, groups);
    281             lock (pendingOptimizersByJobId) {
     280          lock (pendingOptimizerMappingsLocker) {
     281            foreach (IOptimizer optimizer in parentOptimizersByPendingOptimizer.Keys) {
     282              SerializedJob serializedJob = CreateSerializedJob(optimizer);
     283              ResponseObject<JobDto> response = clientFacade.AddJobWithGroupStrings(serializedJob, groups);
    282284              pendingOptimizersByJobId.Add(response.Obj.Id, optimizer);
     285
     286              JobItem jobItem = new JobItem() {
     287                JobDto = response.Obj,
     288                LatestSnapshot = null,
     289                Optimizer = optimizer
     290              };
     291              lock (jobItems) {
     292                jobItems.Add(jobItem);
     293              }
     294              LogMessage(jobItem.JobDto.Id, "Job sent to Hive");
    283295            }
    284 
    285             JobItem jobItem = new JobItem() {
    286               JobDto = response.Obj,
    287               LatestSnapshot = null,
    288               Optimizer = optimizer
    289             };
    290             lock (jobItems) {
    291               jobItems.Add(jobItem);
    292             }
    293             LogMessage(jobItem.JobDto.Id, "Job sent to Hive");
    294296          }
    295297        }
     
    396398
    397399    private bool NoMorePendingOptimizers() {
    398       lock (pendingOptimizersByJobId) {
     400      lock (pendingOptimizerMappingsLocker) {
    399401        return pendingOptimizersByJobId.Count == 0;
    400402      }
     
    408410    /// <param name="jobId"></param>
    409411    private void DisposeOptimizerMappings(Guid jobId) {
    410       lock (pendingOptimizersByJobId) {
    411         LogMessage(jobId, "Disposing Optimizer Mappings");
     412      LogMessage(jobId, "Disposing Optimizer Mappings");
     413      lock (pendingOptimizerMappingsLocker) {
    412414        parentOptimizersByPendingOptimizer.Remove(pendingOptimizersByJobId[jobId]);
    413415        pendingOptimizersByJobId.Remove(jobId);
     
    436438    private void JobItem_JobStateChanged(object sender, EventArgs e) {
    437439      JobItem jobItem = (JobItem)sender;
     440
    438441      Thread t = new Thread(() => {
    439         if (jobItem.State == JobState.Finished) {
    440           FetchAndUpdateJob(jobItem.JobDto.Id);
    441           DisposeOptimizerMappings(jobItem.JobDto.Id);
    442         } else if (jobItem.State == JobState.Failed) {
    443           DisposeOptimizerMappings(jobItem.JobDto.Id);
    444         }
    445 
    446         if (NoMorePendingOptimizers()) {
    447           StopResultPolling();
    448           this.ExecutionState = Core.ExecutionState.Stopped;
    449           OnStopped();
     442        try {
     443          if (jobItem.State == JobState.Finished) {
     444            FetchAndUpdateJob(jobItem.JobDto.Id);
     445            DisposeOptimizerMappings(jobItem.JobDto.Id);
     446          } else if (jobItem.State == JobState.Failed) {
     447            DisposeOptimizerMappings(jobItem.JobDto.Id);
     448          }
     449
     450          if (NoMorePendingOptimizers()) {
     451            StopResultPolling();
     452            this.ExecutionState = Core.ExecutionState.Stopped;
     453            OnStopped();
     454          }
     455        }
     456        catch (Exception ex) {
     457          Logger.Error("JobItem_JobStateChanged failed badly: " + ex.Message);
     458          LogMessage("JobItem_JobStateChanged failed badly: " + ex.Message);
    450459        }
    451460      });
     
    457466    /// </summary>
    458467    private void FetchAndUpdateJob(Guid jobId) {
     468      bool tryagain = false;
    459469      LogMessage(jobId, "FetchAndUpdateJob started");
    460       IClientFacade clientFacade = CreateStreamedClientFacade();
    461       IOptimizer originalOptimizer;
    462       lock (pendingOptimizersByJobId) {
    463         originalOptimizer = pendingOptimizersByJobId[jobId];
    464       }
    465 
    466       fetchJobSemaphore.WaitOne();
    467       ResponseObject<SerializedJob> jobResponse = clientFacade.GetLastSerializedResult(jobId, false, false);
    468       ServiceLocator.DisposeClientFacade(clientFacade);
    469       IJob restoredObject = XmlParser.Deserialize<IJob>(new MemoryStream(jobResponse.Obj.SerializedJobData));
    470       IOptimizer restoredOptimizer = ((OptimizerJob)restoredObject).Optimizer;
    471 
    472       ReplaceOptimizer(parentOptimizersByPendingOptimizer[originalOptimizer], originalOptimizer, restoredOptimizer);
    473       fetchJobSemaphore.Release();
    474       LogMessage(jobId, "FetchAndUpdateJob ended");
     470      if (fetchJobSemaphore.WaitOne(new TimeSpan(0, 2, 0))) {
     471        IClientFacade clientFacade = null;
     472        try {
     473          clientFacade = CreateStreamedClientFacade();
     474          IOptimizer originalOptimizer;
     475          originalOptimizer = pendingOptimizersByJobId[jobId];
     476
     477          ResponseObject<SerializedJob> jobResponse = clientFacade.GetLastSerializedResult(jobId, false, false);
     478          IJob restoredObject = XmlParser.Deserialize<IJob>(new MemoryStream(jobResponse.Obj.SerializedJobData));
     479          IOptimizer restoredOptimizer = ((OptimizerJob)restoredObject).Optimizer;
     480          ReplaceOptimizer(parentOptimizersByPendingOptimizer[originalOptimizer], originalOptimizer, restoredOptimizer);
     481          LogMessage(jobId, "FetchAndUpdateJob ended");
     482        }
     483        catch (Exception e) {
     484          LogMessage(jobId, "FetchAndUpdateJob failed: " + e.Message + ". Will try again!");
     485          tryagain = true;
     486        }
     487        finally {
     488          ServiceLocator.DisposeClientFacade(clientFacade);
     489          fetchJobSemaphore.Release();
     490        }
     491      } else {
     492        LogMessage(jobId, "FetchAndUpdateJob timed out. Will try again!");
     493        tryagain = true;
     494      }
     495
     496      if (tryagain) {
     497        FetchAndUpdateJob(jobId);
     498      }
    475499    }
    476500
     
    509533        PluginsNeeded = pluginsNeeded,
    510534        State = JobState.Offline,
    511         MemoryNeeded = 0,
    512         UserId = Guid.Empty // [chn] set real userid here!
     535        MemoryNeeded = 0
    513536      };
    514537
     
    537560    public void StopResultPolling() {
    538561      this.stopResultsPollingPending = true;
    539       resultPollingThread.Interrupt();
     562      if (resultPollingThread != null && resultPollingThread.ThreadState == System.Threading.ThreadState.WaitSleepJoin) {
     563        resultPollingThread.Interrupt();
     564      }
    540565      this.stopResultsPollingPending = false;
    541566    }
     
    581606          // thread has been interuppted
    582607        }
     608        catch (Exception e) {
     609          LogMessage("Result Polling Thread failed badly: " + e.Message);
     610          Logger.Error("Result Polling Thread failed badly: " + e.Message);
     611        }
    583612        finally {
    584613          this.IsPollingResults = false;
     
    598627    public void RequestSnapshot(Guid jobId) {
    599628      Thread t = new Thread(() => {
    600         IClientFacade clientFacade = CreateStreamedClientFacade();
     629        IClientFacade clientFacade = null;
    601630        try {
     631          clientFacade = CreateStreamedClientFacade();
     632
    602633          ResponseObject<SerializedJob> response;
    603634          int retryCount = 0;
     
    633664          }
    634665        }
     666        catch (Exception e) {
     667          LogMessage("RequestSnapshot Thread failed badly: " + e.Message);
     668          Logger.Error("RequestSnapshot Thread failed badly: " + e.Message);
     669        }
    635670        finally {
    636671          ServiceLocator.DisposeClientFacade(clientFacade);
     
    885920          clientFacade = ServiceLocator.CreateClientFacade(Settings.Default.HiveServerIp);
    886921
    887         } catch (EndpointNotFoundException exception) {
     922        }
     923        catch (EndpointNotFoundException exception) {
    888924          LogMessage("Could not connect to Server: " + exception.Message + ". Will try again in " + (resultPollingIntervalMs / 1000) + " sec.");
    889925          Thread.Sleep(resultPollingIntervalMs);
     
    899935          //clientFacade = ServiceLocator.CreateStreamedClientFacade(string.Format("http://{0}:{1}/{2}", Settings.Default.HiveServerIp, Settings.Default.HiveServerPort, WcfSettings.ClientStreamedServiceName));
    900936          clientFacade = ServiceLocator.CreateStreamedClientFacade(Settings.Default.HiveServerIp);
    901         } catch (EndpointNotFoundException exception) {
     937        }
     938        catch (EndpointNotFoundException exception) {
    902939          LogMessage("Could not connect to Server: " + exception.Message + ". Will try again in " + (resultPollingIntervalMs / 1000) + " sec.");
    903940          Thread.Sleep(resultPollingIntervalMs);
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/app.config

    r4316 r4333  
    3232            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
    3333            transactionFlow="false" transferMode="Streamed" transactionProtocol="OleTransactions"
    34             hostNameComparisonMode="StrongWildcard" listenBacklog="10"
    35             maxBufferPoolSize="104857600" maxBufferSize="104857600" maxConnections="10"
     34            hostNameComparisonMode="StrongWildcard" listenBacklog="100"
     35            maxBufferPoolSize="104857600" maxBufferSize="104857600" maxConnections="100"
    3636            maxReceivedMessageSize="104857600">
    3737          <readerQuotas maxDepth="32" maxStringContentLength="104857600" maxArrayLength="104857600"
     
    4747            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    4848            transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
    49             hostNameComparisonMode="StrongWildcard" listenBacklog="10"
    50             maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
     49            hostNameComparisonMode="StrongWildcard" listenBacklog="100"
     50            maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="100"
    5151            maxReceivedMessageSize="65536">
    5252          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ClientFacade.cs

    r4302 r4333  
    6262    public Response RequestSnapshot(Guid jobId) {
    6363      using (contextFactory.GetContext()) {
     64        ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId);
    6465        return jobManager.RequestSnapshot(jobId);
    6566      }
     
    7071    public ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId, bool requested, bool snapshot) {
    7172      using (contextFactory.GetContext(false)) {
     73        ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId);
    7274        return jobManager.GetLastSerializedResult(jobId, requested, snapshot);
    7375      }
     
    7880    public ResponseObject<JobDto> GetJobById(Guid jobId) {
    7981      using (contextFactory.GetContext(false)) {
     82        ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId);
    8083        return jobManager.GetJobById(jobId);
    8184      }
     
    8689    public Response AbortJob(Guid jobId) {
    8790      using (contextFactory.GetContext()) {
     91        ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId);
    8892        return jobManager.AbortJob(jobId);
    8993      }
     
    9498    public ResponseObject<JobResultList> GetJobResults(IEnumerable<Guid> jobIds) {
    9599      using (contextFactory.GetContext(false)) {
     100        ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobIds.ToArray());
    96101        return jobManager.GetJobResults(jobIds);
    97102      }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ServerConsoleFacade.cs

    r4302 r4333  
    3333using System.Security.Permissions;
    3434
    35       //IIdentity id = ServiceSecurityContext.Current.PrimaryIdentity;
    36       //if (!Thread.CurrentPrincipal.IsInRole("Administrator")) {
    37 
    38       //} else {
    39       //  // access denied
    40       //  throw new SecurityException();
    41       //}
    42 
    4335namespace HeuristicLab.Hive.Server.Core {
    4436  public class ServerConsoleFacade : IServerConsoleFacade {
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/SlaveFacade.cs

    r4305 r4333  
    7777    public ResponseResultReceived StoreFinishedJobResult(Guid slaveId, Guid jobId, byte[] result, double percentage, string exception) {
    7878      using (contextFactory.GetContext()) {
     79        ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId);
    7980        return slaveCommunicator.StoreFinishedJobResult(slaveId, jobId, result, percentage, exception);
    8081      }
     
    9394    public Response IsJobStillNeeded(Guid jobId) {
    9495      using (contextFactory.GetContext()) {
    95         return slaveCommunicator.IsJobStillNeeded(jobId);
     96        ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId);
     97        return slaveCommunicator.IsJobStillNeeded(jobId);
    9698      }
    9799    }
     
    100102    [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)]
    101103    public ResponseList<CachedHivePluginInfoDto> GetPlugins(List<HivePluginInfoDto> pluginList) {
    102       return slaveCommunicator.GetPlugins(pluginList);     
     104      return slaveCommunicator.GetPlugins(pluginList);
    103105    }
    104106
     
    107109    public ResponseResultReceived ProcessSnapshot(Guid slaveId, Guid jobId, byte[] result, double percentage, string exception) {
    108110      using (contextFactory.GetContext()) {
    109         return slaveCommunicator.ProcessSnapshot(slaveId, jobId, result, percentage, exception);
     111        ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId);
     112        return slaveCommunicator.ProcessSnapshot(slaveId, jobId, result, percentage, exception);
    110113      }
    111114    }
     
    115118    public ResponseCalendar GetCalendar(Guid slaveId) {
    116119      using (contextFactory.GetContext()) {
    117         return slaveCommunicator.GetCalendar(slaveId); 
     120        return slaveCommunicator.GetCalendar(slaveId);
    118121      }
    119122    }
     
    121124    [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)]
    122125    [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)]
    123     public Response SetCalendarStatus(Guid slaveId, CalendarState state) { 
     126    public Response SetCalendarStatus(Guid slaveId, CalendarState state) {
    124127      using (contextFactory.GetContext()) {
    125128        return slaveCommunicator.SetCalendarStatus(slaveId, state);
     
    137140    public Stream GetStreamedJob(Guid slaveId) {
    138141      using (contextFactory.GetContext(false)) {
     142        ResponseObject<JobDto> job = null;
    139143        MultiStream stream = new MultiStream();
    140 
    141         ResponseObject<JobDto> job = null;
    142 
    143144        job = ServiceLocator.GetSlaveCommunicator().GetJob(slaveId);
    144145
     
    183184    public ResponseResultReceived ProcessSnapshotStreamed(Stream stream) {
    184185      using (contextFactory.GetContext()) {
    185         return ((IInternalSlaveCommunicator)slaveCommunicator).ProcessJobResult(stream, false); 
     186        return ((IInternalSlaveCommunicator)slaveCommunicator).ProcessJobResult(stream, false);
    186187      }
    187188    }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/HeuristicLab.Hive.Server.Core-3.3.csproj

    r4302 r4333  
    114114  </ItemGroup>
    115115  <ItemGroup>
     116    <Compile Include="Authorization\AuthorizationManager.cs" />
    116117    <Compile Include="CreateHiveDatabaseApplication.cs" />
    117118    <Compile Include="SlaveCommunicator.cs" />
     
    122123    <Compile Include="Facades\ClientFacade.cs" />
    123124    <Compile Include="HeuristicLabHiveServerCorePlugin.cs" />
    124     <Compile Include="InternalInterfaces\IHivePermissionManager.cs" />
     125    <Compile Include="InternalInterfaces\IAuthorizationManager.cs" />
    125126    <Compile Include="InternalInterfaces\IInternalSlaveCommunicator.cs" />
    126127    <Compile Include="InternalInterfaces\IInternalJobManager.cs" />
     
    158159    </ProjectReference>
    159160  </ItemGroup>
    160   <ItemGroup>
    161     <Folder Include="Authorization\" />
    162   </ItemGroup>
     161  <ItemGroup />
    163162  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
    164163  <ProjectExtensions>
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/InternalInterfaces/IInternalSlaveCommunicator.cs

    r4263 r4333  
    3131namespace HeuristicLab.Hive.Server.Core.InternalInterfaces {
    3232  interface IInternalSlaveCommunicator {
    33     ResponseResultReceived ProcessJobResult(
    34       Stream stream,
    35       bool finished);
     33    ResponseResultReceived ProcessJobResult(Stream stream, bool finished);
    3634  }
    3735}
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/JobManager.cs

    r4267 r4333  
    167167
    168168        job.JobInfo.DateCreated = DateTime.Now;
     169        job.JobInfo.UserId = ServiceLocator.GetAuthorizationManager().UserId;
    169170        DaoLocator.JobDao.InsertWithAttachedJob(job);
    170171        DaoLocator.PluginInfoDao.InsertPluginDependenciesForJob(job.JobInfo);
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/ServiceLocator.cs

    r4302 r4333  
    4242
    4343    private static ILifecycleManager lifecycleManager = null;
    44 
    45     private static ISessionFactory sessionFactory = null;
    46 
     44   
    4745    private static IScheduler scheduler = null;
    4846
    49     //private static IPermissionManager permManager = null;
    50 
    51     private static IHivePermissionManager hivePermManager = null;
    52 
     47    private static IAuthorizationManager authorizationManager = null;
     48   
    5349    private static IContextFactory contextFactory = null;
    5450
     
    118114    /// </summary>
    119115    /// <returns></returns>
    120     //[MethodImpl(MethodImplOptions.Synchronized)]
    121     //public static IPermissionManager GetPermissionManager() {
    122     //  if (permManager == null)
    123     //    permManager = ApplicationManager.Manager.GetInstances<IPermissionManager>().First();
    124     //  return permManager;
    125 
    126     //}
    127 
    128     ///// <summary>
    129     ///// Gets the permission manager
    130     ///// </summary>
    131     ///// <returns></returns>
    132     //[MethodImpl(MethodImplOptions.Synchronized)]
    133     //public static IHivePermissionManager GetHivePermissionManager() {
    134     //  if (hivePermManager == null)
    135     //    hivePermManager = ApplicationManager.Manager.GetInstances<IHivePermissionManager>().First();
    136     //  return hivePermManager;
    137 
    138     //}
     116    [MethodImpl(MethodImplOptions.Synchronized)]
     117    public static IAuthorizationManager GetAuthorizationManager() {
     118      if (authorizationManager == null)
     119        authorizationManager = ApplicationManager.Manager.GetInstances<IAuthorizationManager>().First();
     120      return authorizationManager;
     121    }
    139122
    140123    /// <summary>
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/SlaveCommunicator.cs

    r4305 r4333  
    247247    /// check if there is work for the slave and send the slave a response if he should pull a job
    248248    /// </summary>
    249     /// <param name="hbData"></param>
     249    /// <param name="heartbeatData"></param>
    250250    /// <returns></returns>
    251     public ResponseHeartBeat ProcessHeartBeat(HeartBeatData hbData) {
    252       Logger.Debug("BEGIN Processing Heartbeat for Slave " + hbData.SlaveId);
     251    public ResponseHeartBeat ProcessHeartBeat(HeartBeatData heartbeatData) {
     252      Logger.Debug("BEGIN Processing Heartbeat for Slave " + heartbeatData.SlaveId);
    253253
    254254      ResponseHeartBeat response = new ResponseHeartBeat();
     
    256256
    257257      Logger.Debug("BEGIN Started Slave Fetching");
    258       SlaveDto slave = DaoLocator.SlaveDao.FindById(hbData.SlaveId);
     258      SlaveDto slave = DaoLocator.SlaveDao.FindById(heartbeatData.SlaveId);
    259259      Logger.Debug("END Finished Slave Fetching");
    260260
    261       slave.NrOfFreeCores = hbData.FreeCores;
    262       slave.FreeMemory = hbData.FreeMemory;
    263       slave.IsAllowedToCalculate = hbData.IsAllowedToCalculate;
     261      slave.NrOfFreeCores = heartbeatData.FreeCores;
     262      slave.FreeMemory = heartbeatData.FreeMemory;
     263      slave.IsAllowedToCalculate = heartbeatData.IsAllowedToCalculate;
    264264
    265265      // check if the slave is logged in
     
    275275      heartbeatLock.EnterWriteLock();
    276276      Logger.Debug("END Locked for Heartbeats");
    277       if (lastHeartbeats.ContainsKey(hbData.SlaveId)) {
    278         lastHeartbeats[hbData.SlaveId] = DateTime.Now;
     277      if (lastHeartbeats.ContainsKey(heartbeatData.SlaveId)) {
     278        lastHeartbeats[heartbeatData.SlaveId] = DateTime.Now;
    279279      } else {
    280         lastHeartbeats.Add(hbData.SlaveId, DateTime.Now);
     280        lastHeartbeats.Add(heartbeatData.SlaveId, DateTime.Now);
    281281      }
    282282      heartbeatLock.ExitWriteLock();
    283283
    284284      Logger.Debug("BEGIN Processing Heartbeat Jobs");
    285       ProcessJobProcess(hbData, response);
     285      ProcessJobProcess(heartbeatData, response);
    286286      Logger.Debug("END Processed Heartbeat Jobs");
    287287
     
    296296      // if true, ask scheduler for a new job for this slave
    297297      Logger.Debug(" BEGIN Looking for Slave Jobs");
    298       if (slave.IsAllowedToCalculate && hbData.FreeCores > 0 && scheduler.ExistsJobForSlave(hbData)) {
     298      if (slave.IsAllowedToCalculate && heartbeatData.FreeCores > 0 && scheduler.ExistsJobForSlave(heartbeatData)) {
    299299        response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.FetchJob));
    300300      } else {
     
    306306
    307307      //tx.Commit();
    308       Logger.Debug(" END Processed Heartbeat for Slave " + hbData.SlaveId);
     308      Logger.Debug(" END Processed Heartbeat for Slave " + heartbeatData.SlaveId);
    309309      return response;
    310310    }
     
    341341      if (hbData.JobProgress != null && hbData.JobProgress.Count > 0) {
    342342        if (jobsOfSlave == null || jobsOfSlave.Count == 0) {
    343           //response.Success = false;
    344           //response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOB_IS_NOT_BEEING_CALCULATED;
    345 
    346343          foreach (Guid jobId in hbData.JobProgress.Keys) {
    347344            response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, jobId));
     
    354351        foreach (KeyValuePair<Guid, double> jobProgress in hbData.JobProgress) {
    355352          JobDto curJob = DaoLocator.JobDao.FindById(jobProgress.Key);
     353          if (curJob == null) {
     354            response.StatusMessage = ResponseStatus.ProcessJobResult_JobDoesNotExist;
     355            response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, jobProgress.Key));
     356            Logger.Error("Job does not exist in DB: " + jobProgress.Key);
     357            return;
     358          }
    356359          curJob.Slave = DaoLocator.SlaveDao.GetSlaveForJob(curJob.Id);
    357360          if (curJob.Slave == null || curJob.Slave.Id != hbData.SlaveId) {
    358             //response.Success = false;
    359             //response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_JOB_IS_NOT_BEEING_CALCULATED;
    360361            response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id));
    361362            Logger.Error("There is no job calculated by this user " + hbData.SlaveId + " Job: " + curJob);
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/app.config

    r4320 r4333  
    11<?xml version="1.0" encoding="utf-8" ?>
    22<configuration>
     3  <system.diagnostics>
     4    <sources>
     5      <source name="Warnings" switchValue="Warning, ActivityTracing">
     6        <listeners>
     7          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
     8            <filter type="" />
     9          </add>
     10        </listeners>
     11      </source>
     12    </sources>
     13    <sharedListeners>
     14      <add type="System.Diagnostics.EventLogTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
     15        name="EventLogTracer" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack">
     16        <filter type="" />
     17      </add>
     18    </sharedListeners>
     19  </system.diagnostics>
    320  <connectionStrings>
    421    <add name="HeuristicLab.Authentication"
     
    2643
    2744  <system.serviceModel>
    28    
     45
     46    <diagnostics>
     47      <messageLogging logEntireMessage="true" logMalformedMessages="true"
     48        logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true"
     49        maxMessagesToLog="3000" />
     50    </diagnostics>
    2951    <bindings>
    3052      <netTcpBinding>
    3153        <binding name="TcpStreamedBinding" sendTimeout="00:10:00" transferMode="Streamed"
    32           maxBufferPoolSize="104857600" maxBufferSize="104857600" maxReceivedMessageSize="104857600">
     54          maxBufferPoolSize="104857600" maxBufferSize="104857600"
     55          maxReceivedMessageSize="104857600" maxConnections="100" listenBacklog="100">
    3356          <readerQuotas maxStringContentLength="104857600" maxArrayLength="104857600" />
    3457          <security mode="TransportWithMessageCredential">
    35             <transport clientCredentialType="Certificate" />
     58            <transport clientCredentialType="Certificate"/>
    3659            <message clientCredentialType="UserName" />
    3760          </security>
     
    3962      </netTcpBinding>
    4063      <wsHttpBinding>
    41         <binding name="HttpBinding">
     64        <binding name="HiveServerHttpBinding">
    4265          <security mode="Message">
     66            <transport/>
    4367            <message clientCredentialType="UserName" />
    4468          </security>
     
    6084          <serviceSecurityAudit auditLogLocation="Application" suppressAuditFailure="false"
    6185            messageAuthenticationAuditLevel="SuccessOrFailure" />
     86          <serviceThrottling maxConcurrentCalls="100"/>
    6287        </behavior>
    6388      </serviceBehaviors>
     
    6590    <services>
    6691      <service behaviorConfiguration="ServiceBehaviour" name="HeuristicLab.Hive.Server.Core.SlaveFacade">
    67         <endpoint address="" binding="wsHttpBinding" bindingConfiguration="HttpBinding"
     92        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="HiveServerHttpBinding"
    6893          name="SlaveHttpEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.ISlaveFacade" />
    69         <endpoint address="mex" binding="mexHttpBinding" name="SlaveMexEndpoint"
     94        <endpoint address="mex" binding="mexHttpBinding" name="SlaveMexEndpoint" bindingConfiguration=""
    7095          contract="HeuristicLab.Hive.Contracts.Interfaces.ISlaveFacade" />
    7196        <endpoint binding="netTcpBinding" bindingConfiguration="TcpStreamedBinding"
     
    81106      </service>
    82107      <service behaviorConfiguration="ServiceBehaviour" name="HeuristicLab.Hive.Server.Core.ServerConsoleFacade">
    83         <endpoint address="" binding="wsHttpBinding" bindingConfiguration="HttpBinding"
     108        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="HiveServerHttpBinding"
    84109          name="ServerConsoleHttpEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IServerConsoleFacade" />
    85110        <endpoint address="mex" binding="mexHttpBinding" name="ServerConsoleMexEndpoint"
     
    96121        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
    97122          name="ClientTcpMexEndpoint" contract="IMetadataExchange" />
    98         <endpoint binding="wsHttpBinding" bindingConfiguration="HttpBinding"
     123        <endpoint binding="wsHttpBinding" bindingConfiguration="HiveServerHttpBinding"
    99124          name="ClientHttpEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IClientFacade" />
    100125        <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
     
    108133      </service>
    109134    </services>
    110    
     135
    111136  </system.serviceModel>
    112  
     137
    113138</configuration>
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.DataAccess/3.3/IJobDao.cs

    r4267 r4333  
    2020
    2121    IEnumerable<JobDto> FindFittingJobsForSlave(JobState state, int freeCores, int freeMemory, Guid slaveGuid);
     22
    2223    Stream GetSerializedJobStream(Guid jobId);
    2324
     
    2728
    2829    IEnumerable<JobDto> FindJobsById(IEnumerable<Guid> jobIds);
     30
     31    bool IsUserAuthorizedForJobs(string userId, params Guid[] jobIds);
    2932  }
    3033}
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.LINQDataAccess/3.3/HeuristicLab.Hive.Server.LINQDataAccess-3.3.csproj

    r4296 r4333  
    128128    <None Include="HeuristicLab.snk" />
    129129    <None Include="Properties\AssemblyInfo.frame" />
     130    <None Include="Scripts\UpdateContext.bat" />
    130131  </ItemGroup>
    131132  <ItemGroup>
     
    156157      <SubType>Designer</SubType>
    157158    </Content>
     159    <Content Include="Scripts\cleanHiveDatabase.sql" />
     160    <Content Include="Scripts\prepareHiveDatabase.sql" />
    158161  </ItemGroup>
    159162  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.LINQDataAccess/3.3/HiveDataContext.cs

    r4267 r4333  
    19791979    private System.Nullable<System.Guid> _ProjectId;
    19801980   
    1981     private System.Nullable<System.Guid> _UserId;
     1981    private string _UserId;
    19821982   
    19831983    private int _CoresNeeded;
     
    20252025    partial void OnProjectIdChanging(System.Nullable<System.Guid> value);
    20262026    partial void OnProjectIdChanged();
    2027     partial void OnUserIdChanging(System.Nullable<System.Guid> value);
     2027    partial void OnUserIdChanging(string value);
    20282028    partial void OnUserIdChanged();
    20292029    partial void OnCoresNeededChanging(int value);
     
    22962296    }
    22972297   
    2298     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
    2299     public System.Nullable<System.Guid> UserId
     2298    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="VarChar(MAX)")]
     2299    public string UserId
    23002300    {
    23012301      get
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.LINQDataAccess/3.3/HiveDataContext.xml

    r4267 r4333  
    107107      <Column Name="Priority" Member="Priority" DbType="Int NOT NULL" Type="System.Int32"/>
    108108      <Column Name="ProjectId" Member="ProjectId" DbType="UniqueIdentifier" Type="System.Guid" CanBeNull="true"/>
    109       <Column Name="UserId" Member="UserId" DbType="UniqueIdentifier" Type="System.Guid" CanBeNull="true"/>
     109      <Column Name="UserId" Member="UserId" DbType="VarChar(MAX)" Type="System.String" CanBeNull="true"/>
    110110      <Column Name="CoresNeeded" Member="CoresNeeded" DbType="Int NOT NULL" Type="System.Int32"/>
    111111      <Column Name="MemoryNeeded" Member="MemoryNeeded" DbType="Int NOT NULL" Type="System.Int32"/>
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.LINQDataAccess/3.3/JobDao.cs

    r4267 r4333  
    150150                                where jobIds.Contains(job.JobId)
    151151                                select EntityToDto(job, null);
    152 
    153152      return jobs.ToList();
     153    }
     154
     155    public bool IsUserAuthorizedForJobs(string userId, params Guid[] jobIds) {
     156      var jobs = from job in Context.Jobs
     157                 where jobIds.Contains(job.JobId)
     158                 select job;
     159      return jobs.All(job => job.UserId == userId);
    154160    }
    155161    #endregion
     
    174180      target.Priority = source.Priority;
    175181      target.JobState = Enum.GetName(typeof(JobState), source.State);
     182      target.UserId = source.UserId;
    176183      return target;
    177184    }
     
    185192        target = new JobDto();
    186193
    187       //target.ParentJob = null;
    188       //target.PluginsNeeded = null;
    189       //target.Slave = null;
    190       //target.Project = null;
    191 
    192194      target.CoresNeeded = source.CoresNeeded;
    193195      target.MemoryNeeded = source.MemoryNeeded;
     
    197199      target.DateFinished = source.DateFinished;
    198200      target.Id = source.JobId;
    199 
     201     
    200202      target.Exception = source.Exception;
    201203      target.Percentage = source.Percentage;
     
    203205      target.Priority = source.Priority;
    204206      target.State = (JobState)Enum.Parse(typeof(JobState), source.JobState, true);
     207      target.UserId = source.UserId;
    205208      return target;
    206209    }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3/HeuristicLabHiveServerApplication.cs

    r4316 r4333  
    3535  [Application("Hive Server", "Server application for the distributed hive engine.", false)]
    3636  public class HeuristicLabHiveServerApplication : ApplicationBase {
    37     //private Dictionary<string, Uri> baseAddrDict = new Dictionary<string, Uri>();
    3837    private IDictionary<string, ServiceHost> serviceHosts = new Dictionary<string, ServiceHost>();
    3938    ILifecycleManager lifecycleManager = null;
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/WcfService.cs

    r4316 r4333  
    103103        proxy.Open();
    104104        Logger.Debug("Opened the Connection");
    105 
     105       
    106106        ConnState = NetworkEnum.WcfConnState.Connected;
    107107        ConnectedSince = DateTime.Now;
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/app.config

    r4316 r4333  
    2323          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
    2424          transactionFlow="false" transferMode="Streamed" transactionProtocol="OleTransactions"
    25           hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="104857600"
    26           maxBufferSize="104857600" maxConnections="10" maxReceivedMessageSize="104857600">
     25          hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="104857600"
     26          maxBufferSize="104857600" maxConnections="100" listenBacklog="100" maxReceivedMessageSize="104857600">
    2727          <readerQuotas maxDepth="32" maxStringContentLength="104857600" maxArrayLength="104857600"
    2828            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
     
    3737          receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false"
    3838          transferMode="Buffered" transactionProtocol="OleTransactions"
    39           hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288"
    40           maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
     39          hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288"
     40          maxBufferSize="65536" maxConnections="100" listenBacklog="100" maxReceivedMessageSize="65536">
    4141          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    4242            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Console/3.3/app.config

    r4320 r4333  
    1919          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    2020          transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
    21           hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288"
    22           maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
     21          hostNameComparisonMode="StrongWildcard" listenBacklog="100" maxBufferPoolSize="524288"
     22          maxBufferSize="65536" maxConnections="100" maxReceivedMessageSize="65536">
    2323          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    2424            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/ConfigurationManager/ConfigManager.cs

    r4320 r4333  
    114114      st.JobsFetched = SlaveStatusInfo.JobsFetched;
    115115
    116       Dictionary<Guid, Executor> engines = Core.GetExecutionEngines();
     116      Dictionary<Guid, Executor> engines = Core.ExecutionEngines;
    117117      st.Jobs = new List<JobStatus>();
    118118
     
    128128    public Dictionary<Guid, double> GetProgressOfAllJobs() {
    129129      Dictionary<Guid, double> prog = new Dictionary<Guid, double>();
    130       Dictionary<Guid, Executor> engines = Core.GetExecutionEngines();
     130      Dictionary<Guid, Executor> engines = Core.ExecutionEngines;
    131131      lock (engines) {
    132132        foreach (KeyValuePair<Guid, Executor> kvp in engines) {
     
    140140
    141141    public int GetUsedCores() {
    142       Dictionary<Guid, Executor> engines = Core.GetExecutionEngines();
    143       Dictionary<Guid, JobDto> jobs = Core.GetJobs();
     142      Dictionary<Guid, Executor> engines = Core.ExecutionEngines;
     143      Dictionary<Guid, JobDto> jobs = Core.Jobs;
    144144      int usedCores = 0;
    145145      lock (engines) {
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/Core.cs

    r4320 r4333  
    4444    public static bool abortRequested { get; set; }
    4545
    46     private bool _currentlyFetching;
     46    private bool currentlyFetching;
    4747    private bool CurrentlyFetching {
    4848      get {
    49         return _currentlyFetching;
     49        return currentlyFetching;
    5050      }
    5151      set {
    52         _currentlyFetching = value;
    53         Logger.Debug("Set CurrentlyFetching to " + _currentlyFetching);
     52        currentlyFetching = value;
     53        Logger.Debug("Set CurrentlyFetching to " + currentlyFetching);
    5454      }
    5555    }
     
    6969      Logger.Info("Hive Slave started");
    7070      SlaveConsoleServer server = new SlaveConsoleServer();
    71       server.StartClientConsoleServer();
     71      server.Start();
    7272     
    7373      ConfigManager manager = ConfigManager.Instance;
    7474      manager.Core = this;
    7575
    76       //Register all Wcf Service references
    7776      wcfService = WcfService.Instance;
     77      RegisterServiceEvents();
     78
     79      RecoverSettings(); // recover server IP from the settings framework
     80      StartHeartbeats(); // Start heartbeats thread
     81      DispatchMessageQueue(); // dispatch messages until abortRequested
     82
     83      DeRegisterServiceEvents();
     84      server.Close();
     85      Logger.Info("Program shutdown");
     86    }
     87
     88    private void RecoverSettings() {
     89      ConnectionContainer cc = ConfigManager.Instance.GetServerIP();
     90      if (cc.IPAdress != String.Empty) {
     91        wcfService.SetIP(cc.IPAdress);
     92      }
     93    }
     94
     95    private void StartHeartbeats() {
     96      //Initialize the heartbeat
     97      beat = new HeartbeatManager { Interval = new TimeSpan(0, 0, 10) };
     98      beat.StartHeartbeat();
     99    }
     100
     101    private void DispatchMessageQueue() {
     102      MessageQueue queue = MessageQueue.GetInstance();
     103      while (!abortRequested) {
     104        MessageContainer container = queue.GetMessage();
     105        DetermineAction(container);
     106      }
     107    }
     108
     109    private void RegisterServiceEvents() {
    78110      wcfService.GetJobCompleted += new EventHandler<GetJobCompletedEventArgs>(wcfService_GetJobCompleted);
    79111      wcfService.GetFinishedJobResultCompleted += new EventHandler<StoreFinishedJobResultCompletedEventArgs>(wcfService_StoreFinishedJobResultCompleted);
     
    82114      wcfService.ServerChanged += new EventHandler(wcfService_ServerChanged);
    83115      wcfService.Connected += new EventHandler(wcfService_Connected);
    84 
    85       //Recover Server IP and Port from the Settings Framework
    86       ConnectionContainer cc = ConfigManager.Instance.GetServerIP();
    87       if (cc.IPAdress != String.Empty)
    88         wcfService.SetIP(cc.IPAdress);
    89 
    90       //Initialize the heartbeat
    91       beat = new HeartbeatManager { Interval = new TimeSpan(0, 0, 10) };
    92       beat.StartHeartbeat();
    93 
    94       MessageQueue queue = MessageQueue.GetInstance();
    95 
    96       //Main processing loop     
    97       //Todo: own thread for message handling
    98       //Rly?!
    99       while (!abortRequested) {
    100         MessageContainer container = queue.GetMessage();
    101         DetermineAction(container);
    102       }
    103       Logger.Info("Program shutdown");
     116    }
     117
     118    private void DeRegisterServiceEvents() {
     119      wcfService.GetJobCompleted -= new EventHandler<GetJobCompletedEventArgs>(wcfService_GetJobCompleted);
     120      wcfService.GetFinishedJobResultCompleted -= new EventHandler<StoreFinishedJobResultCompletedEventArgs>(wcfService_StoreFinishedJobResultCompleted);
     121      wcfService.ProcessSnapshotCompleted -= new EventHandler<ProcessSnapshotCompletedEventArgs>(wcfService_ProcessSnapshotCompleted);
     122      wcfService.ConnectionRestored -= new EventHandler(wcfService_ConnectionRestored);
     123      wcfService.ServerChanged -= new EventHandler(wcfService_ServerChanged);
     124      wcfService.Connected -= new EventHandler(wcfService_Connected);
    104125    }
    105126
     
    433454    #endregion
    434455
    435     public Dictionary<Guid, Executor> GetExecutionEngines() {
    436       return engines;
     456    public Dictionary<Guid, Executor> ExecutionEngines {
     457      get { return engines; }
     458    }
     459
     460    internal Dictionary<Guid, JobDto> Jobs {
     461      get { return jobs; }
    437462    }
    438463
    439464    void appDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) {
    440465      Logger.Error("Exception in AppDomain: " + e.ExceptionObject.ToString());
    441     }
    442 
    443     internal Dictionary<Guid, JobDto> GetJobs() {
    444       return jobs;
    445466    }
    446467
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/SlaveConsoleService/SlaveConsoleServer.cs

    r4320 r4333  
    1111namespace HeuristicLab.Hive.Slave.Core.SlaveConsoleService {
    1212  public class SlaveConsoleServer {
    13     public ServiceHost StartClientConsoleServer() {
    14       ServiceHost host = new ServiceHost(ApplicationManager.Manager.GetTypes(typeof(ISlaveConsoleCommunicator)).First());
     13    ServiceHost host = null;
     14
     15    public void Start() {
     16      host = new ServiceHost(ApplicationManager.Manager.GetTypes(typeof(ISlaveConsoleCommunicator)).First());
    1517      host.Open();
    16       return host;
     18    }
     19
     20    public void Close() {
     21      host.Close();
    1722    }
    1823  }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/app.config

    r4320 r4333  
    2626    <bindings>
    2727      <netTcpBinding>
    28         <binding name="SlaveConsoleTcpBinding">
     28        <binding name="SlaveConsoleTcpBinding" listenBacklog="100" maxConnections="100">
    2929          <security mode="None">
    30             <transport>
    31               <extendedProtectionPolicy policyEnforcement="Never" />
    32             </transport>
     30            <transport/>
    3331          </security>
    3432        </binding>
     
    4139          name="SlaveConsoleTcpEndpoint" contract="HeuristicLab.Hive.Slave.Core.SlaveConsoleService.Interfaces.ISlaveConsoleCommunicator" />
    4240        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
    43           name="SlaveConsoleTcpMexBinding" contract="IMetadataExchange" />
     41          name="SlaveConsoleTcpMexEndpoint" contract="IMetadataExchange" />
    4442        <host>
    4543          <baseAddresses>
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive/3.3/HeuristicLab.Hive-3.3.dll.config

    r4302 r4333  
    1010    <gcServer enabled="true"/>
    1111  </runtime>
    12 
    1312</configuration>
Note: See TracChangeset for help on using the changeset viewer.