Sorting the tasks in non-decreasing order of watts for max-greedymins and max-min. Had unintentionally removed the sorting of tasks for max-greedymins and max-mins.
This commit is contained in:
parent
1b9442bf50
commit
cb71153362
2 changed files with 12 additions and 6 deletions
|
@ -1,16 +1,17 @@
|
||||||
package schedulers
|
package schedulers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"time"
|
||||||
|
|
||||||
"bitbucket.org/sunybingcloud/elektron/def"
|
"bitbucket.org/sunybingcloud/elektron/def"
|
||||||
"bitbucket.org/sunybingcloud/elektron/utilities/mesosUtils"
|
"bitbucket.org/sunybingcloud/elektron/utilities/mesosUtils"
|
||||||
"bitbucket.org/sunybingcloud/elektron/utilities/offerUtils"
|
"bitbucket.org/sunybingcloud/elektron/utilities/offerUtils"
|
||||||
"fmt"
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
mesos "github.com/mesos/mesos-go/mesosproto"
|
mesos "github.com/mesos/mesos-go/mesosproto"
|
||||||
"github.com/mesos/mesos-go/mesosutil"
|
"github.com/mesos/mesos-go/mesosutil"
|
||||||
sched "github.com/mesos/mesos-go/scheduler"
|
sched "github.com/mesos/mesos-go/scheduler"
|
||||||
"log"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Decides if to take an offer or not.
|
// Decides if to take an offer or not.
|
||||||
|
@ -40,6 +41,8 @@ type MaxGreedyMins struct {
|
||||||
// Initialization.
|
// Initialization.
|
||||||
func (s *MaxGreedyMins) init(opts ...schedPolicyOption) {
|
func (s *MaxGreedyMins) init(opts ...schedPolicyOption) {
|
||||||
s.base.init(opts...)
|
s.base.init(opts...)
|
||||||
|
// Sorting the tasks based on watts.
|
||||||
|
def.SortTasks(s.tasks, def.SortByWatts)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *MaxGreedyMins) newTask(offer *mesos.Offer, task def.Task) *mesos.TaskInfo {
|
func (s *MaxGreedyMins) newTask(offer *mesos.Offer, task def.Task) *mesos.TaskInfo {
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
package schedulers
|
package schedulers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"time"
|
||||||
|
|
||||||
"bitbucket.org/sunybingcloud/elektron/def"
|
"bitbucket.org/sunybingcloud/elektron/def"
|
||||||
"bitbucket.org/sunybingcloud/elektron/utilities/mesosUtils"
|
"bitbucket.org/sunybingcloud/elektron/utilities/mesosUtils"
|
||||||
"bitbucket.org/sunybingcloud/elektron/utilities/offerUtils"
|
"bitbucket.org/sunybingcloud/elektron/utilities/offerUtils"
|
||||||
"fmt"
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
mesos "github.com/mesos/mesos-go/mesosproto"
|
mesos "github.com/mesos/mesos-go/mesosproto"
|
||||||
"github.com/mesos/mesos-go/mesosutil"
|
"github.com/mesos/mesos-go/mesosutil"
|
||||||
sched "github.com/mesos/mesos-go/scheduler"
|
sched "github.com/mesos/mesos-go/scheduler"
|
||||||
"log"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Decides if to take an offer or not.
|
// Decides if to take an offer or not.
|
||||||
|
@ -40,6 +41,8 @@ type MaxMin struct {
|
||||||
// Initialization.
|
// Initialization.
|
||||||
func (s *MaxMin) init(opts ...schedPolicyOption) {
|
func (s *MaxMin) init(opts ...schedPolicyOption) {
|
||||||
s.base.init(opts...)
|
s.base.init(opts...)
|
||||||
|
// Sorting the tasks based on Watts.
|
||||||
|
def.SortTasks(s.tasks, def.SortByWatts)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *MaxMin) newTask(offer *mesos.Offer, task def.Task) *mesos.TaskInfo {
|
func (s *MaxMin) newTask(offer *mesos.Offer, task def.Task) *mesos.TaskInfo {
|
||||||
|
|
Reference in a new issue