Added proactive cluster wide capping with ranked tasks as another scheduler.

This commit is contained in:
Pradyumna Kaushik 2016-11-25 18:00:55 -05:00 committed by Renan DelValle
parent 81d795f197
commit 72bd54374c

View file

@ -114,10 +114,10 @@ func (s *ProactiveClusterwideCapRanked) newTask(offer *mesos.Offer, task def.Tas
task.SetTaskID(*proto.String("electron-" + taskName))
// Add task to the list of tasks running on the node.
s.running[offer.GetSlaveId().GoString()][taskName] = true
if len(s.taskMonitor[offer.GetSlaveId().GoString()]) == 0 {
s.taskMonitor[offer.GetSlaveId().GoString()] = []def.Task{task}
if len(s.taskMonitor[*offer.Hostname]) == 0 {
s.taskMonitor[*offer.Hostname] = []def.Task{task}
} else {
s.taskMonitor[offer.GetSlaveId().GoString()] = append(s.taskMonitor[offer.GetSlaveId().GoString()], task)
s.taskMonitor[*offer.Hostname] = append(s.taskMonitor[*offer.Hostname], task)
}
resources := []*mesos.Resource{