used sort interface instead of the quickSort algorithm to sort tasks in ascending order of watts.

This commit is contained in:
Pradyumna Kaushik 2016-12-16 15:52:47 -05:00 committed by Renan DelValle
parent d69c5006ed
commit c493bd066e

View file

@ -21,6 +21,7 @@ import (
sched "github.com/mesos/mesos-go/scheduler"
"log"
"math"
"sort"
"strings"
"sync"
"time"
@ -263,7 +264,7 @@ func (s *ProactiveClusterwideCapRanked) ResourceOffers(driver sched.SchedulerDri
// sorting the tasks in ascending order of watts.
if (len(s.tasks) > 0) {
s.capper.sortTasks(&s.tasks)
sort.Sort(def.WattsSorter(s.tasks))
// calculating the total number of tasks ranked.
numberOfRankedTasks := 0
for _, task := range s.tasks {