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 892d9b86dc
commit f67773dcde

View file

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