Skip to content

Commit

Permalink
[YUNIKORN-2887] Optimize sortApplications function code
Browse files Browse the repository at this point in the history
  • Loading branch information
hiwangzhihui committed Sep 24, 2024
1 parent 5e3535c commit d5e20e8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/scheduler/objects/sorters.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,15 @@ func sortQueuesByFairnessAndPriority(queues []*Queue) {

func sortApplications(apps map[string]*Application, sortType policies.SortPolicy, considerPriority bool, globalResource *resources.Resource) []*Application {
sortingStart := time.Now()
var sortedApps []*Application
sortedApps := filterOnPendingResources(apps)
switch sortType {
case policies.FairSortPolicy:
sortedApps = filterOnPendingResources(apps)
if considerPriority {
sortApplicationsByPriorityAndFairness(sortedApps, globalResource)
} else {
sortApplicationsByFairnessAndPriority(sortedApps, globalResource)
}
case policies.FifoSortPolicy:
sortedApps = filterOnPendingResources(apps)
if considerPriority {
sortApplicationsByPriorityAndSubmissionTime(sortedApps)
} else {
Expand Down

0 comments on commit d5e20e8

Please sign in to comment.