Example #1
0
func (self *manager) HandleReshuffleTasks() {
	tasks := self.GetRunningTasks()
	for _, task := range tasks {
		if task.Reshuffleable == false {
			continue
		}
		if task.Sla == managerInterface.SLA_ONE_PER_NODE {
			continue
		}

		self.HandleDeleteTask(task)
		newTask := managerInterface.CopyTask(*task)
		managerInterface.ResetTask(&newTask)
		self.HandleRunDockerImage(&newTask)
	}
}
Example #2
0
func (self *manager) HandleRunDockerImage(task *managerInterface.Task) {
	if task.Sla == managerInterface.SLA_ONE_PER_NODE {
		if self.isDuplicateRunRequest(task) {
			return
		}
		for _, node := range nodeRegistry.Nodes() {
			newTask := managerInterface.CopyTask(*task)
			newTask.NodeName = node.NodeName
			self.handleRunDockerImageImpl(&newTask)
		}
	} else if task.Sla == managerInterface.SLA_SINGLETON {
		if self.isDuplicateRunRequest(task) {
			return
		}
		self.handleRunDockerImageImpl(task)
	} else {
		self.handleRunDockerImageImpl(task)
	}
}