Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7132


Ignore:
Timestamp:
12/06/11 12:49:34 (13 years ago)
Author:
ascheibe
Message:

#1672

  • fixed name of slave windows service

reviewing comments:

  • reduced MaxParallelDownloads to 2 to not completely overload cpus
  • renamed ServiceLocator to HiveServiceLocator
Location:
trunk/sources
Files:
13 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/Properties/Settings.Designer.cs

    r6983 r7132  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.235
     4//     Runtime Version:4.0.30319.239
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    6262        [global::System.Configuration.UserScopedSettingAttribute()]
    6363        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    64         [global::System.Configuration.DefaultSettingValueAttribute("HeuristicLab.Clients.Hive.SlaveCore.WindowsService")]
     64        [global::System.Configuration.DefaultSettingValueAttribute("HeuristicLab.Clients.Hive.Slave")]
    6565        public string ServiceName {
    6666            get {
  • trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/Properties/Settings.settings

    r6983 r7132  
    1313    </Setting>
    1414    <Setting Name="ServiceName" Type="System.String" Scope="User">
    15       <Value Profile="(Default)">HeuristicLab.Clients.Hive.SlaveCore.WindowsService</Value>
     15      <Value Profile="(Default)">HeuristicLab.Clients.Hive.Slave</Value>
    1616    </Setting>
    1717  </Settings>
  • trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/app.config

    r6983 r7132  
    1717                <value>SlaveCommunicationServiceEndpoint</value>
    1818            </setting>
     19            <setting name="ServiceName" serializeAs="String">
     20                <value>HeuristicLab.Clients.Hive.Slave</value>
     21            </setting>
    1922        </HeuristicLab.Clients.Hive.SlaveCore.Views.Properties.Settings>
    2023    </userSettings>
  • trunk/sources/HeuristicLab.Clients.Hive.Slave/3.3/WcfService.cs

    r6983 r7132  
    4242        if (instance == null) {
    4343          instance = new WcfService();
    44           ServiceLocator.Instance.Username = HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings.Default.SlaveUser;
    45           ServiceLocator.Instance.Password = HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings.Default.SlavePwd;
     44          HiveServiceLocator.Instance.Username = HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings.Default.SlaveUser;
     45          HiveServiceLocator.Instance.Password = HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings.Default.SlavePwd;
    4646        }
    4747        return instance;
     
    161161    public void CallHiveService(Action<IHiveService> call) {
    162162      try {
    163         ServiceLocator.Instance.CallHiveService(call);
     163        HiveServiceLocator.Instance.CallHiveService(call);
    164164      }
    165165      catch (Exception ex) {
     
    170170    private T CallHiveService<T>(Func<IHiveService, T> call) {
    171171      try {
    172         return ServiceLocator.Instance.CallHiveService(call);
     172        return HiveServiceLocator.Instance.CallHiveService(call);
    173173      }
    174174      catch (Exception ex) {
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/ConcurrentTaskDownloader.cs

    r7125 r7132  
    6969
    7070    private Task DownloadTask(object taskId) {
    71       return ServiceLocator.Instance.CallHiveService(s => s.GetTask((Guid)taskId));
     71      return HiveServiceLocator.Instance.CallHiveService(s => s.GetTask((Guid)taskId));
    7272    }
    7373
     
    8181      try {
    8282        if (abort) return null;
    83         result = ServiceLocator.Instance.CallHiveService(s => s.GetTaskData(task.Id));
     83        result = HiveServiceLocator.Instance.CallHiveService(s => s.GetTaskData(task.Id));
    8484      } finally {
    8585        downloadSemaphore.Release();
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/HeuristicLab.Clients.Hive-3.3.csproj

    r7021 r7132  
    116116    </Compile>
    117117    <Compile Include="Exceptions\ResourceNotFoundException.cs" />
    118     <Compile Include="IServiceLocator.cs" />
     118    <Compile Include="IHiveServiceLocator.cs" />
    119119    <Compile Include="Tasks\EngineTask.cs" />
    120120    <Compile Include="Tasks\OptimizerTask.cs" />
     
    149149    <Compile Include="ServiceClients\HiveServiceClient.cs" />
    150150    <Compile Include="ServiceClients\Task.cs" />
    151     <Compile Include="ServiceLocator.cs" />
     151    <Compile Include="HiveServiceLocator.cs" />
    152152    <None Include="HeuristicLab.snk" />
    153153    <None Include="ServiceClients\GenerateServiceClients.cmd" />
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveAdminClient.cs

    r6976 r7132  
    7979        resources = new ItemList<Resource>();
    8080
    81         ServiceLocator.Instance.CallHiveService(service => {
     81        HiveServiceLocator.Instance.CallHiveService(service => {
    8282          service.GetSlaveGroups().ForEach(g => resources.Add(g));
    8383          service.GetSlaves().ForEach(s => resources.Add(s));
     
    101101          downtimes = new ItemList<Downtime>();
    102102
    103           ServiceLocator.Instance.CallHiveService(service => {
     103          HiveServiceLocator.Instance.CallHiveService(service => {
    104104            service.GetDowntimesForResource(downtimeForResourceId).ForEach(d => downtimes.Add(d));
    105105          });
     
    119119      if (item.Id == Guid.Empty) {
    120120        if (item is SlaveGroup) {
    121           item.Id = ServiceLocator.Instance.CallHiveService((s) => s.AddSlaveGroup((SlaveGroup)item));
     121          item.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddSlaveGroup((SlaveGroup)item));
    122122        }
    123123        if (item is Slave) {
    124           item.Id = ServiceLocator.Instance.CallHiveService((s) => s.AddSlave((Slave)item));
     124          item.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddSlave((Slave)item));
    125125        }
    126126        if (item is Downtime) {
    127           item.Id = ServiceLocator.Instance.CallHiveService((s) => s.AddDowntime((Downtime)item));
     127          item.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddDowntime((Downtime)item));
    128128        }
    129129      } else {
    130130        if (item is SlaveGroup) {
    131           ServiceLocator.Instance.CallHiveService((s) => s.UpdateSlaveGroup((SlaveGroup)item));
     131          HiveServiceLocator.Instance.CallHiveService((s) => s.UpdateSlaveGroup((SlaveGroup)item));
    132132        }
    133133        if (item is Slave) {
    134           ServiceLocator.Instance.CallHiveService((s) => s.UpdateSlave((Slave)item));
     134          HiveServiceLocator.Instance.CallHiveService((s) => s.UpdateSlave((Slave)item));
    135135        }
    136136        if (item is Downtime) {
    137           ServiceLocator.Instance.CallHiveService((s) => s.UpdateDowntime((Downtime)item));
     137          HiveServiceLocator.Instance.CallHiveService((s) => s.UpdateDowntime((Downtime)item));
    138138        }
    139139      }
     
    144144    public static void Delete(IHiveItem item) {
    145145      if (item is SlaveGroup) {
    146         ServiceLocator.Instance.CallHiveService((s) => s.DeleteSlaveGroup(item.Id));
     146        HiveServiceLocator.Instance.CallHiveService((s) => s.DeleteSlaveGroup(item.Id));
    147147      } else if (item is Slave) {
    148         ServiceLocator.Instance.CallHiveService((s) => s.DeleteSlave(item.Id));
     148        HiveServiceLocator.Instance.CallHiveService((s) => s.DeleteSlave(item.Id));
    149149      } else if (item is Downtime) {
    150         ServiceLocator.Instance.CallHiveService((s) => s.DeleteDowntime(item.Id));
     150        HiveServiceLocator.Instance.CallHiveService((s) => s.DeleteDowntime(item.Id));
    151151      }
    152152    }
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs

    r7125 r7132  
    8282
    8383      try {
    84         this.IsAllowedPrivileged = ServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged());
     84        this.IsAllowedPrivileged = HiveServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged());
    8585
    8686        var oldJobs = jobs ?? new ItemCollection<RefreshableJob>();
    8787        jobs = new HiveItemCollection<RefreshableJob>();
    88         var jobsLoaded = ServiceLocator.Instance.CallHiveService<IEnumerable<Job>>(s => s.GetJobs());
     88        var jobsLoaded = HiveServiceLocator.Instance.CallHiveService<IEnumerable<Job>>(s => s.GetJobs());
    8989
    9090        foreach (var j in jobsLoaded) {
     
    142142        if (item is JobPermission) {
    143143          var hep = (JobPermission)item;
    144           hep.GrantedUserId = ServiceLocator.Instance.CallHiveService((s) => s.GetUserIdByUsername(hep.GrantedUserName));
     144          hep.GrantedUserId = HiveServiceLocator.Instance.CallHiveService((s) => s.GetUserIdByUsername(hep.GrantedUserName));
    145145          if (hep.GrantedUserId == Guid.Empty) {
    146146            throw new ArgumentException(string.Format("The user {0} was not found.", hep.GrantedUserName));
    147147          }
    148           ServiceLocator.Instance.CallHiveService((s) => s.GrantPermission(hep.JobId, hep.GrantedUserId, hep.Permission));
     148          HiveServiceLocator.Instance.CallHiveService((s) => s.GrantPermission(hep.JobId, hep.GrantedUserId, hep.Permission));
    149149        }
    150150      } else {
    151151        if (item is Job)
    152           ServiceLocator.Instance.CallHiveService(s => s.UpdateJob((Job)item));
     152          HiveServiceLocator.Instance.CallHiveService(s => s.UpdateJob((Job)item));
    153153      }
    154154    }
     
    176176
    177177      if (item is Job)
    178         ServiceLocator.Instance.CallHiveService(s => s.DeleteJob(item.Id));
     178        HiveServiceLocator.Instance.CallHiveService(s => s.DeleteJob(item.Id));
    179179      if (item is RefreshableJob)
    180         ServiceLocator.Instance.CallHiveService(s => s.DeleteJob(item.Id));
     180        HiveServiceLocator.Instance.CallHiveService(s => s.DeleteJob(item.Id));
    181181      if (item is JobPermission) {
    182182        var hep = (JobPermission)item;
    183         ServiceLocator.Instance.CallHiveService(s => s.RevokePermission(hep.JobId, hep.GrantedUserId));
     183        HiveServiceLocator.Instance.CallHiveService(s => s.RevokePermission(hep.JobId, hep.GrantedUserId));
    184184      }
    185185      item.Id = Guid.Empty;
     
    215215
    216216    public static void PauseJob(RefreshableJob refreshableJob) {
    217       ServiceLocator.Instance.CallHiveService(service => {
     217      HiveServiceLocator.Instance.CallHiveService(service => {
    218218        foreach (HiveTask task in refreshableJob.GetAllHiveTasks()) {
    219219          if (task.Task.State != TaskState.Finished && task.Task.State != TaskState.Aborted && task.Task.State != TaskState.Failed)
     
    225225
    226226    public static void StopJob(RefreshableJob refreshableJob) {
    227       ServiceLocator.Instance.CallHiveService(service => {
     227      HiveServiceLocator.Instance.CallHiveService(service => {
    228228        foreach (HiveTask task in refreshableJob.GetAllHiveTasks()) {
    229229          if (task.Task.State != TaskState.Finished && task.Task.State != TaskState.Aborted && task.Task.State != TaskState.Failed)
     
    246246        var resourceIds = new List<Guid>();
    247247        foreach (var resourceName in resourceNames) {
    248           Guid resourceId = ServiceLocator.Instance.CallHiveService((s) => s.GetResourceId(resourceName));
     248          Guid resourceId = HiveServiceLocator.Instance.CallHiveService((s) => s.GetResourceId(resourceName));
    249249          if (resourceId == Guid.Empty) {
    250250            throw new ResourceNotFoundException(string.Format("Could not find the resource '{0}'", resourceName));
     
    259259        // upload Job
    260260        refreshableJob.Progress.Status = "Uploading Job...";
    261         refreshableJob.Job.Id = ServiceLocator.Instance.CallHiveService((s) => s.AddJob(refreshableJob.Job));
     261        refreshableJob.Job.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddJob(refreshableJob.Job));
    262262        bool isPrivileged = refreshableJob.Job.IsPrivileged;
    263         refreshableJob.Job = ServiceLocator.Instance.CallHiveService((s) => s.GetJob(refreshableJob.Job.Id)); // update owner and permissions
     263        refreshableJob.Job = HiveServiceLocator.Instance.CallHiveService((s) => s.GetJob(refreshableJob.Job.Id)); // update owner and permissions
    264264        refreshableJob.Job.IsPrivileged = isPrivileged;
    265265        cancellationToken.ThrowIfCancellationRequested();
     
    271271        // upload plugins
    272272        refreshableJob.Progress.Status = "Uploading plugins...";
    273         this.OnlinePlugins = ServiceLocator.Instance.CallHiveService((s) => s.GetPlugins());
     273        this.OnlinePlugins = HiveServiceLocator.Instance.CallHiveService((s) => s.GetPlugins());
    274274        this.AlreadyUploadedPlugins = new List<Plugin>();
    275         Plugin configFilePlugin = ServiceLocator.Instance.CallHiveService((s) => UploadConfigurationFile(s, onlinePlugins));
     275        Plugin configFilePlugin = HiveServiceLocator.Instance.CallHiveService((s) => UploadConfigurationFile(s, onlinePlugins));
    276276        this.alreadyUploadedPlugins.Add(configFilePlugin);
    277277        cancellationToken.ThrowIfCancellationRequested();
     
    357357          if (!cancellationToken.IsCancellationRequested) {
    358358            lock (pluginLocker) {
    359               ServiceLocator.Instance.CallHiveService((s) => hiveTask.Task.PluginsNeededIds = PluginUtil.GetPluginDependencies(s, this.onlinePlugins, this.alreadyUploadedPlugins, plugins));
     359              HiveServiceLocator.Instance.CallHiveService((s) => hiveTask.Task.PluginsNeededIds = PluginUtil.GetPluginDependencies(s, this.onlinePlugins, this.alreadyUploadedPlugins, plugins));
    360360            }
    361361          }
     
    370370          if (!cancellationToken.IsCancellationRequested) {
    371371            if (parentHiveTask != null) {
    372               hiveTask.Task.Id = ServiceLocator.Instance.CallHiveService((s) => s.AddChildTask(parentHiveTask.Task.Id, hiveTask.Task, taskData));
     372              hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddChildTask(parentHiveTask.Task.Id, hiveTask.Task, taskData));
    373373            } else {
    374               hiveTask.Task.Id = ServiceLocator.Instance.CallHiveService((s) => s.AddTask(hiveTask.Task, taskData, groups.ToList()));
     374              hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddTask(hiveTask.Task, taskData, groups.ToList()));
    375375            }
    376376          }
     
    417417        // fetch all task objects to create the full tree of tree of HiveTask objects
    418418        refreshableJob.Progress.Status = "Downloading list of tasks...";
    419         allTasks = ServiceLocator.Instance.CallHiveService(s => s.GetLightweightJobTasks(hiveExperiment.Id));
     419        allTasks = HiveServiceLocator.Instance.CallHiveService(s => s.GetLightweightJobTasks(hiveExperiment.Id));
    420420        totalJobCount = allTasks.Count();
    421421
     
    480480
    481481    public static ItemTask LoadItemJob(Guid jobId) {
    482       TaskData taskData = ServiceLocator.Instance.CallHiveService(s => s.GetTaskData(jobId));
     482      TaskData taskData = HiveServiceLocator.Instance.CallHiveService(s => s.GetTaskData(jobId));
    483483      try {
    484484        return PersistenceUtil.Deserialize<ItemTask>(taskData.Data);
     
    505505
    506506    public static HiveItemCollection<JobPermission> GetJobPermissions(Guid jobId) {
    507       return ServiceLocator.Instance.CallHiveService((service) => {
     507      return HiveServiceLocator.Instance.CallHiveService((service) => {
    508508        IEnumerable<JobPermission> jps = service.GetJobPermissions(jobId);
    509509        foreach (var hep in jps) {
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveJobs/HiveTask.cs

    r7125 r7132  
    456456        try {
    457457          foreach (var child in childHiveTasks) {
    458             ServiceLocator.Instance.CallHiveService(s => s.PauseTask(child.task.Id));
     458            HiveServiceLocator.Instance.CallHiveService(s => s.PauseTask(child.task.Id));
    459459          }
    460460        }
    461461        finally { childHiveTasksLock.ExitReadLock(); }
    462462      } else {
    463         ServiceLocator.Instance.CallHiveService(s => s.PauseTask(this.task.Id));
     463        HiveServiceLocator.Instance.CallHiveService(s => s.PauseTask(this.task.Id));
    464464      }
    465465    }
     
    470470        try {
    471471          foreach (var child in childHiveTasks) {
    472             ServiceLocator.Instance.CallHiveService(s => s.StopTask(child.task.Id));
     472            HiveServiceLocator.Instance.CallHiveService(s => s.StopTask(child.task.Id));
    473473          }
    474474        }
    475475        finally { childHiveTasksLock.ExitReadLock(); }
    476476      } else {
    477         ServiceLocator.Instance.CallHiveService(s => s.StopTask(this.task.Id));
     477        HiveServiceLocator.Instance.CallHiveService(s => s.StopTask(this.task.Id));
    478478      }
    479479    }
    480480
    481481    public void Restart() {
    482       ServiceLocator.Instance.CallHiveService(service => {
     482      HiveServiceLocator.Instance.CallHiveService(service => {
    483483        TaskData taskData = new TaskData();
    484484        taskData.TaskId = this.task.Id;
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveServiceLocator.cs

    r7129 r7132  
    2424
    2525namespace HeuristicLab.Clients.Hive {
    26   public class ServiceLocator : IServiceLocator {
    27     private static IServiceLocator instance = null;
    28     public static IServiceLocator Instance {
     26  public class HiveServiceLocator : IHiveServiceLocator {
     27    private static IHiveServiceLocator instance = null;
     28    public static IHiveServiceLocator Instance {
    2929      get {
    3030        if (instance == null) {
    31           instance = new ServiceLocator();
     31          instance = new HiveServiceLocator();
    3232        }
    3333        return instance;
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/IHiveServiceLocator.cs

    r7129 r7132  
    2323
    2424namespace HeuristicLab.Clients.Hive {
    25   public interface IServiceLocator {
     25  public interface IHiveServiceLocator {
    2626    string Username { get; set; }
    2727    string Password { get; set; }
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/JobResultPoller.cs

    r6976 r7132  
    106106
    107107    public IEnumerable<LightweightTask> FetchJobResults() {
    108       return ServiceLocator.Instance.CallHiveService(service => {
     108      return HiveServiceLocator.Instance.CallHiveService(service => {
    109109        var responses = new List<LightweightTask>();
    110110        responses.AddRange(service.GetLightweightJobTasks(jobId));
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/Settings.Designer.cs

    r7125 r7132  
    5353        [global::System.Configuration.ApplicationScopedSettingAttribute()]
    5454        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    55         [global::System.Configuration.DefaultSettingValueAttribute("5")]
     55        [global::System.Configuration.DefaultSettingValueAttribute("2")]
    5656        public int MaxParallelDownloads {
    5757            get {
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/Settings.settings

    r7125 r7132  
    1313    </Setting>
    1414    <Setting Name="MaxParallelDownloads" Type="System.Int32" Scope="Application">
    15       <Value Profile="(Default)">5</Value>
     15      <Value Profile="(Default)">2</Value>
    1616    </Setting>
    1717    <Setting Name="MaxRepeatServiceCalls" Type="System.Int32" Scope="Application">
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/app.config

    r7125 r7132  
    1818      </setting>
    1919      <setting name="MaxParallelDownloads" serializeAs="String">
    20         <value>5</value>
     20        <value>2</value>
    2121      </setting>
    2222      <setting name="MaxRepeatServiceCalls" serializeAs="String">
Note: See TracChangeset for help on using the changeset viewer.