Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/04/13 16:29:03 (12 years ago)
Author:
ascheibe
Message:

#1712 merged changes from trunk into branch and improved scheduler performance

Location:
branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Scheduler
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Scheduler/RoundRobinTaskScheduler.cs

    r8998 r9109  
    3636      var userPriorities = dao.GetUserPriorities(x => true).OrderBy(x => x.DateEnqueued).ToArray();
    3737
    38       var jobs = new List<Job>();
     38      var jobs = new List<JobInfoForScheduler>();
    3939      foreach (var userPriority in userPriorities) {
    40         jobs.AddRange(dao.GetJobs(x => x.OwnerUserId == userPriority.Id));
     40        jobs.AddRange(dao.GetJobInfoForScheduler(x => x.OwnerUserId == userPriority.Id));
    4141      }
    4242
     
    4444        task => task.JobId,
    4545        job => job.Id,
    46         (task, job) => new { Task = task, Job = job })
     46        (task, job) => new { Task = task, JobInfo = job })
    4747        .OrderByDescending(x => x.Task.Priority)
    4848        .ToList();
     
    5555      for (int i = 0; i < count; i++) {
    5656        var defaultEntry = taskJobRelations.First(); // search first task which is not included yet
    57         var priorityEntries = taskJobRelations.Where(x => x.Job.OwnerUserId == userPriorities[priorityIndex].Id).ToArray(); // search for tasks with desired user priority
     57        var priorityEntries = taskJobRelations.Where(x => x.JobInfo.OwnerUserId == userPriorities[priorityIndex].Id).ToArray(); // search for tasks with desired user priority
    5858        while (!priorityEntries.Any() && ++priorityIndex < userPriorities.Length)
    59           priorityEntries = taskJobRelations.Where(x => x.Job.OwnerUserId == userPriorities[priorityIndex].Id).ToArray();
     59          priorityEntries = taskJobRelations.Where(x => x.JobInfo.OwnerUserId == userPriorities[priorityIndex].Id).ToArray();
    6060        if (priorityEntries.Any()) { // tasks with desired user priority found
    61           var priorityEntry = priorityEntries.OrderByDescending(x => x.Task.Priority).ThenBy(x => x.Job.DateCreated).First();
     61          var priorityEntry = priorityEntries.OrderByDescending(x => x.Task.Priority).ThenBy(x => x.JobInfo.DateCreated).First();
    6262          if (defaultEntry.Task.Priority <= priorityEntry.Task.Priority) {
    6363            taskJobRelations.Remove(priorityEntry);
Note: See TracChangeset for help on using the changeset viewer.