formatted code.
This commit is contained in:
parent
c31bf8db01
commit
9599588fb5
4 changed files with 22 additions and 22 deletions
|
@ -3,6 +3,7 @@ package schedulers
|
|||
import (
|
||||
"bitbucket.org/sunybingcloud/elektron/def"
|
||||
elecLogDef "bitbucket.org/sunybingcloud/elektron/logging/def"
|
||||
"bitbucket.org/sunybingcloud/elektron/utilities"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
@ -12,7 +13,6 @@ import (
|
|||
"log"
|
||||
"sync"
|
||||
"time"
|
||||
"bitbucket.org/sunybingcloud/elektron/utilities"
|
||||
)
|
||||
|
||||
type baseScheduler struct {
|
||||
|
@ -21,13 +21,13 @@ type baseScheduler struct {
|
|||
// Current scheduling policy used for resource offer consumption.
|
||||
curSchedPolicy SchedPolicyState
|
||||
|
||||
tasksCreated int
|
||||
tasksRunning int
|
||||
tasks []def.Task
|
||||
metrics map[string]def.Metric
|
||||
running map[string]map[string]bool
|
||||
wattsAsAResource bool
|
||||
classMapWatts bool
|
||||
tasksCreated int
|
||||
tasksRunning int
|
||||
tasks []def.Task
|
||||
metrics map[string]def.Metric
|
||||
running map[string]map[string]bool
|
||||
wattsAsAResource bool
|
||||
classMapWatts bool
|
||||
totalResourceAvailabilityRecorded bool
|
||||
|
||||
// First set of PCP values are garbage values, signal to logger to start recording when we're
|
||||
|
@ -164,7 +164,7 @@ func (s *baseScheduler) Disconnected(sched.SchedulerDriver) {
|
|||
}
|
||||
|
||||
func (s *baseScheduler) ResourceOffers(driver sched.SchedulerDriver, offers []*mesos.Offer) {
|
||||
utilities.RecordTotalResourceAvailability(offers)
|
||||
utilities.RecordTotalResourceAvailability(offers)
|
||||
s.curSchedPolicy.ConsumeOffers(s, driver, offers)
|
||||
}
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@ package schedulers
|
|||
import (
|
||||
"bitbucket.org/sunybingcloud/elektron/constants"
|
||||
"bitbucket.org/sunybingcloud/elektron/def"
|
||||
"errors"
|
||||
elecLogDef "bitbucket.org/sunybingcloud/elektron/logging/def"
|
||||
"bitbucket.org/sunybingcloud/elektron/utilities"
|
||||
"bitbucket.org/sunybingcloud/elektron/utilities/mesosUtils"
|
||||
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
|
||||
sched "github.com/mesos/mesos-go/api/v0/scheduler"
|
||||
"github.com/pkg/errors"
|
||||
"log"
|
||||
)
|
||||
|
||||
|
@ -130,7 +130,7 @@ func LaunchTasks(offerIDs []*mesos.OfferID, tasksToLaunch []*mesos.TaskInfo, dri
|
|||
driver.LaunchTasks(offerIDs, tasksToLaunch, mesosUtils.DefaultFilter)
|
||||
// Update resource availability
|
||||
var err error
|
||||
for _, task := range tasksToLaunch {
|
||||
for _, task := range tasksToLaunch {
|
||||
err = utilities.ResourceAvailabilityUpdate("ON_TASK_ACTIVE_STATE", *task.TaskId, *task.SlaveId)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
|
Reference in a new issue