used sort interface instead of the quickSort algorithm to sort tasks in ascending order of watts.
This commit is contained in:
parent
d69c5006ed
commit
c493bd066e
1 changed files with 2 additions and 1 deletions
|
@ -21,6 +21,7 @@ import (
|
||||||
sched "github.com/mesos/mesos-go/scheduler"
|
sched "github.com/mesos/mesos-go/scheduler"
|
||||||
"log"
|
"log"
|
||||||
"math"
|
"math"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -263,7 +264,7 @@ func (s *ProactiveClusterwideCapRanked) ResourceOffers(driver sched.SchedulerDri
|
||||||
|
|
||||||
// sorting the tasks in ascending order of watts.
|
// sorting the tasks in ascending order of watts.
|
||||||
if (len(s.tasks) > 0) {
|
if (len(s.tasks) > 0) {
|
||||||
s.capper.sortTasks(&s.tasks)
|
sort.Sort(def.WattsSorter(s.tasks))
|
||||||
// calculating the total number of tasks ranked.
|
// calculating the total number of tasks ranked.
|
||||||
numberOfRankedTasks := 0
|
numberOfRankedTasks := 0
|
||||||
for _, task := range s.tasks {
|
for _, task := range s.tasks {
|
||||||
|
|
Reference in a new issue