This is an automated email from the ASF dual-hosted git repository.

ccondit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git


The following commit(s) were added to refs/heads/master by this push:
     new fe067b77 [YUNIKORN-2887] Optimize sortApplications function code (#974)
fe067b77 is described below

commit fe067b770c25c238449e0b429da92400da8556a4
Author: wzh <[email protected]>
AuthorDate: Tue Sep 24 16:41:25 2024 -0500

    [YUNIKORN-2887] Optimize sortApplications function code (#974)
    
    Closes: #974
    
    Signed-off-by: Craig Condit <[email protected]>
---
 pkg/scheduler/objects/sorters.go | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/pkg/scheduler/objects/sorters.go b/pkg/scheduler/objects/sorters.go
index e677a712..24f9dec7 100644
--- a/pkg/scheduler/objects/sorters.go
+++ b/pkg/scheduler/objects/sorters.go
@@ -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 {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to