Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/18/18 15:08:25 (6 years ago)
Author:
jzenisek
Message:

#2839

  • updated Heartbeat processing (regarding: checking against AssignedJobResources and handling of the updated Job deletion routine)
  • updated Job deletion routine(still in progress at GenerateStatistics)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/TaskDao.cs

    r15628 r15630  
    5454      //Because there is at the moment no case where this makes sense (there don't exist parent tasks which need to be calculated),
    5555      //we skip this step because it's wasted runtime
    56       return DataContext.ExecuteQuery<TaskPriorityInfo>(GetWaitingTasksQueryString, slave.ResourceId, Enum.GetName(typeof(TaskState), TaskState.Waiting), slave.FreeCores, slave.FreeMemory).ToList();
     56      return DataContext.ExecuteQuery<TaskPriorityInfo>(GetWaitingTasksQueryString,
     57        slave.ResourceId,
     58        Enum.GetName(typeof(TaskState), TaskState.Waiting),
     59        slave.FreeCores,
     60        slave.FreeMemory).ToList();
    5761    }
    5862
     
    8892    /// <param name="resourceIds">list of resourceids which for which the task should be valid</param>
    8993    /// <param name="count">maximum number of task to return</param>
    90     /// <param name="finished">if true, all parent task which have FinishWhenChildJobsFinished=true are returned, otherwise only FinishWhenChildJobsFinished=false are returned</param>
     94    /// <param name="finished">if true, all parent tasks which have FinishWhenChildJobsFinished=true are returned, otherwise only FinishWhenChildJobsFinished=false are returned</param>
    9195    /// <returns></returns>
    9296    public IEnumerable<Task> GetParentTasks(IEnumerable<Guid> resourceIds, int count, bool finished) {
     
    129133    ";
    130134    private const string GetWaitingTasksQueryString = @"
     135      WITH rbranch AS (
     136        SELECT ResourceId, ParentResourceId
     137        FROM [Resource]
     138        WHERE ResourceId = {0}
     139        UNION ALL
     140        SELECT r.ResourceId, r.ParentResourceId
     141        FROM [Resource] r
     142        JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId
     143      )
     144      SELECT DISTINCT t.TaskId, t.JobId, t.Priority
     145      FROM [Task] t, [Job] j, [AssignedJobResource] ajr, rbranch
     146      WHERE NOT (t.IsParentTask = 1 AND t.FinishWhenChildJobsFinished = 1)
     147      AND t.TaskState = {1}
     148      AND t.CoresNeeded <= {2}
     149      AND t.MemoryNeeded <= {3}
     150      AND t.JobId = j.JobId
     151      AND j.JobState = 'Online'
     152      AND j.JobId = ajr.JobId
     153      AND ajr.ResourceId = rbranch.ResourceId
     154    ";
     155    private const string GetWaitingTasksQueryStringOld = @"
    131156      WITH pr AS (
    132157        SELECT ResourceId, ParentResourceId
Note: See TracChangeset for help on using the changeset viewer.