Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/17/15 16:57:22 (9 years ago)
Author:
dglaser
Message:

#2388:

HeuristicLab.Services.Hive-3.3:

  • HiveStatisticsGenerator.cs: Jobs that are deleted are now automatically marked as completed in the hive statistics tables. This was added because when a job got paused and deleted afterwards, it would still show up as ongoing job in the hive statistics.
  • Minor changes in NewHiveService.cs

HeuristicLab.Services.WebApp.Statistics-3.3:

  • Expired slaves are now shown as offline (previously the last known state was shown)
  • Adjusted dialog height

HeuristicLab.Services.WebApp-3.3:

  • Changed string.Format to Path.Combine to concate directory paths
Location:
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs

    r12765 r12776  
    134134
    135135    private void UpdateExistingDimJobs(PersistenceManager pm) {
     136      var jobDao = pm.JobDao;
    136137      var dimJobDao = pm.DimJobDao;
    137138      var factTaskDao = pm.FactTaskDao;
     
    151152        }
    152153        if (totalTasks == completedTasks) {
    153           dimJob.DateCompleted = factTaskDao.GetLastCompletedTaskFromJob(dimJob.JobId) ?? DateTime.Now;
     154          var completeDate = factTaskDao.GetLastCompletedTaskFromJob(dimJob.JobId);
     155          if (completeDate == null) {
     156            if (jobDao.GetById(dimJob.JobId) == null) {
     157              completeDate = DateTime.Now;
     158            }
     159          }
     160          dimJob.DateCompleted = completeDate;
    154161        }
    155162        dimJob.TotalTasks = totalTasks;
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/NewHiveService.cs

    r12768 r12776  
    128128    }
    129129
    130     public IEnumerable<Task> GetTasks() {
     130    public IEnumerable<DT.Task> GetTasks() {
    131131      // unused
    132132      throw new NotImplementedException();
    133133    }
    134134
    135     public IEnumerable<LightweightTask> GetLightweightTasks(IEnumerable<Guid> taskIds) {
     135    public IEnumerable<DT.LightweightTask> GetLightweightTasks(IEnumerable<Guid> taskIds) {
    136136      // unused
    137137      throw new NotImplementedException();
    138138    }
    139139
    140     public IEnumerable<LightweightTask> GetLightweightChildTasks(Guid? parentTaskId, bool recursive, bool includeParent) {
     140    public IEnumerable<DT.LightweightTask> GetLightweightChildTasks(Guid? parentTaskId, bool recursive, bool includeParent) {
    141141      // unused
    142142      throw new NotImplementedException();
     
    398398    }
    399399
    400     public IEnumerable<Job> GetAllJobs() {
     400    public IEnumerable<DT.Job> GetAllJobs() {
    401401      // unused
    402402      throw new NotImplementedException();
    403403    }
    404404
    405     public Guid AddJob(Job jobDto) {
     405    public Guid AddJob(DT.Job jobDto) {
    406406      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
    407407      using (var pm = PersistenceManager)
    408408      using (new PerformanceLogger("AddJob")) {
    409409        var jobDao = pm.JobDao;
     410        var userPriorityDao = pm.UserPriorityDao;
    410411        return pm.UseTransaction(() => {
    411412          jobDto.OwnerUserId = UserManager.CurrentUserId;
    412413          jobDto.DateCreated = DateTime.Now;
    413414          var job = jobDao.Save(jobDto.ToEntity());
     415          if (userPriorityDao.GetById(jobDto.OwnerUserId) == null) {
     416            userPriorityDao.Save(new DA.UserPriority {
     417              UserId = jobDto.OwnerUserId,
     418              DateEnqueued = jobDto.DateCreated
     419            });
     420          }
    414421          pm.SubmitChanges();
    415422          return job.JobId;
     
    447454        var jobDao = pm.JobDao;
    448455        pm.UseTransaction(() => {
     456          // child task will be deleted by db-trigger
    449457          jobDao.Delete(jobId);
    450458          pm.SubmitChanges();
     
    546554
    547555    #region Heartbeat Methods
    548     public List<MessageContainer> Heartbeat(Heartbeat heartbeat) {
     556    public List<MessageContainer> Heartbeat(DT.Heartbeat heartbeat) {
    549557      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Slave);
    550558      List<MessageContainer> result = new List<MessageContainer>();
     
    565573
    566574    #region Plugin Methods
    567     public Plugin GetPlugin(Guid pluginId) {
     575    public DT.Plugin GetPlugin(Guid pluginId) {
    568576      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
    569577      using (var pm = PersistenceManager)
     
    574582    }
    575583
    576     public Plugin GetPluginByHash(byte[] hash) {
     584    public DT.Plugin GetPluginByHash(byte[] hash) {
    577585      // unused
    578586      throw new NotImplementedException();
    579587    }
    580588
    581     public Guid AddPlugin(Plugin plugin, List<PluginData> pluginData) {
     589    public Guid AddPlugin(DT.Plugin plugin, List<DT.PluginData> pluginData) {
    582590      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
    583591      using (var pm = PersistenceManager)
     
    593601          pluginEntity = plugin.ToEntity();
    594602          foreach (var data in pluginData) {
    595             data.PluginId = default(Guid);
     603            data.PluginId = default(Guid); // real id will be assigned from linq2sql
    596604            pluginEntity.PluginData.Add(data.ToEntity());
    597605          }
     
    603611    }
    604612
    605     public IEnumerable<Plugin> GetPlugins() {
     613    public IEnumerable<DT.Plugin> GetPlugins() {
    606614      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
    607615      using (var pm = PersistenceManager)
     
    616624    }
    617625
    618     public IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds) {
     626    public IEnumerable<DT.PluginData> GetPluginDatas(List<Guid> pluginIds) {
    619627      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
    620628      using (var pm = PersistenceManager)
     
    668676    }
    669677
    670     public IEnumerable<ResourcePermission> GetResourcePermissions(Guid resourceId) {
     678    public IEnumerable<DT.ResourcePermission> GetResourcePermissions(Guid resourceId) {
    671679      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
    672680      using (var pm = PersistenceManager)
     
    682690
    683691    #region Resource Methods
    684     public IEnumerable<Resource> GetChildResources(Guid resourceId) {
     692    public IEnumerable<DT.Resource> GetChildResources(Guid resourceId) {
    685693      // unused
    686694      throw new NotImplementedException();
     
    718726    }
    719727
    720     public Slave GetSlave(Guid slaveId) {
     728    public DT.Slave GetSlave(Guid slaveId) {
    721729      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator);
    722730      using (var pm = PersistenceManager)
     
    727735    }
    728736
    729     public SlaveGroup GetSlaveGroup(Guid slaveGroupId) {
     737    public DT.SlaveGroup GetSlaveGroup(Guid slaveGroupId) {
    730738      // unused
    731739      throw new NotImplementedException();
    732740    }
    733741
    734     public IEnumerable<Slave> GetSlaves() {
     742    public IEnumerable<DT.Slave> GetSlaves() {
    735743      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
    736744      bool isAdministrator = RoleVerifier.IsInRole(HiveRoles.Administrator);
     
    757765    }
    758766
    759     public IEnumerable<SlaveGroup> GetSlaveGroups() {
     767    public IEnumerable<DT.SlaveGroup> GetSlaveGroups() {
    760768      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
    761769      bool isAdministrator = RoleVerifier.IsInRole(HiveRoles.Administrator);
     
    878886    }
    879887
    880     public IEnumerable<Task> GetTasksByResourceId(Guid resourceId) {
     888    public IEnumerable<DT.Task> GetTasksByResourceId(Guid resourceId) {
    881889      // unused
    882890      throw new NotImplementedException();
     
    967975    }
    968976
    969     public IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId) {
     977    public IEnumerable<DT.Downtime> GetDowntimesForResource(Guid resourceId) {
    970978      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
    971979      using (var pm = PersistenceManager)
     
    9951003
    9961004    #region UserPriorities Methods
    997     public IEnumerable<UserPriority> GetUserPriorities() {
     1005    public IEnumerable<DT.UserPriority> GetUserPriorities() {
    9981006      using (var pm = PersistenceManager)
    9991007      using (new PerformanceLogger("GetUserPriorities")) {
Note: See TracChangeset for help on using the changeset viewer.