- Timestamp:
- 01/04/13 16:29:03 (12 years ago)
- 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 36 36 var userPriorities = dao.GetUserPriorities(x => true).OrderBy(x => x.DateEnqueued).ToArray(); 37 37 38 var jobs = new List<Job >();38 var jobs = new List<JobInfoForScheduler>(); 39 39 foreach (var userPriority in userPriorities) { 40 jobs.AddRange(dao.GetJob s(x => x.OwnerUserId == userPriority.Id));40 jobs.AddRange(dao.GetJobInfoForScheduler(x => x.OwnerUserId == userPriority.Id)); 41 41 } 42 42 … … 44 44 task => task.JobId, 45 45 job => job.Id, 46 (task, job) => new { Task = task, Job = job })46 (task, job) => new { Task = task, JobInfo = job }) 47 47 .OrderByDescending(x => x.Task.Priority) 48 48 .ToList(); … … 55 55 for (int i = 0; i < count; i++) { 56 56 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 priority57 var priorityEntries = taskJobRelations.Where(x => x.JobInfo.OwnerUserId == userPriorities[priorityIndex].Id).ToArray(); // search for tasks with desired user priority 58 58 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(); 60 60 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(); 62 62 if (defaultEntry.Task.Priority <= priorityEntry.Task.Priority) { 63 63 taskJobRelations.Remove(priorityEntry);
Note: See TracChangeset
for help on using the changeset viewer.