Skip to content

Commit

Permalink
[YUNIKORN-2887] Optimize sortApplications function code (#974)
Browse files Browse the repository at this point in the history
Closes: #974

Signed-off-by: Craig Condit <[email protected]>
  • Loading branch information
hiwangzhihui authored and craigcondit committed Sep 24, 2024
1 parent 46ce58d commit fe067b7
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 @@ -100,17 +100,15 @@ func sortQueuesByFairnessAndPriority(queues []*Queue, fairMaxResources []*resour

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 fe067b7

Please sign in to comment.