{"modulePath":"github.com/AliceO2Group/Control","version":"v0.8.4","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package task\n\nPackage task defines the Task type and its Manager, with the purpose of handling the lifetime of O² Task objects. Each Task generally matches a running Mesos Task. All Tasks are kept in a roster in Manager, and the latter also takes care of resource acquisition and deployment.\n\n## Constants\n\n```go\nconst (\n\tCONFIGURE = Event(\"CONFIGURE\")\n\tRESET     = Event(\"RESET\")\n\tSTART     = Event(\"START\")\n\tSTOP      = Event(\"STOP\")\n\tEXIT      = Event(\"EXIT\")\n\tGO_ERROR  = Event(\"GO_ERROR\")\n\tRECOVER   = Event(\"RECOVER\")\n)\n```\n\n```go\nconst (\n\tUNDEFINED = iota\n\tINACTIVE\n\tPARTIAL\n\tACTIVE\n)\n```\n\n## Variables\n\n```go\nvar (\n\tSTATUS_PRODUCT = map[Status]map[Status]Status{\n\t\tUNDEFINED: {\n\t\t\tUNDEFINED: UNDEFINED,\n\t\t\tINACTIVE:  UNDEFINED,\n\t\t\tPARTIAL:   UNDEFINED,\n\t\t\tACTIVE:    UNDEFINED,\n\t\t},\n\t\tINACTIVE: {\n\t\t\tUNDEFINED: UNDEFINED,\n\t\t\tINACTIVE:  INACTIVE,\n\t\t\tPARTIAL:   PARTIAL,\n\t\t\tACTIVE:    PARTIAL,\n\t\t},\n\t\tPARTIAL: {\n\t\t\tUNDEFINED: UNDEFINED,\n\t\t\tINACTIVE:  PARTIAL,\n\t\t\tPARTIAL:   PARTIAL,\n\t\t\tACTIVE:    PARTIAL,\n\t\t},\n\t\tACTIVE: {\n\t\t\tUNDEFINED: UNDEFINED,\n\t\t\tINACTIVE:  PARTIAL,\n\t\t\tPARTIAL:   PARTIAL,\n\t\t\tACTIVE:    ACTIVE,\n\t\t},\n\t}\n)\n```\n\n## Types\n\n```go\ntype AgentCache struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (ac *AgentCache) Count() (count int)\n```\n\n```go\nfunc (ac *AgentCache) Get(id mesos.AgentID) (agent *AgentCacheInfo)\n```\n\n```go\nfunc (ac *AgentCache) Update(agents ...AgentCacheInfo)\n```\n\n```go\ntype AgentCacheInfo struct {\n\tAgentId    mesos.AgentID\n\tAttributes constraint.Attributes\n\tHostname   string\n}\n```\n\n```go\ntype DeploymentMap map[*Task]*Descriptor\n```\n\n```go\ntype Descriptor struct {\n\tTaskRole        parentRole\n\tTaskClassName   string\n\tRoleConstraints constraint.Constraints\n}\n```\n\n```go\ntype Descriptors []*Descriptor\n```\n\n```go\ntype Event string\n```\n\n```go\nfunc (e Event) String() string\n```\n\n```go\ntype EventArgs map[string]string\n```\n\n```go\ntype Filter func(*Task) bool\n```\n\n```go\nvar Filter_NIL Filter = func(*Task) bool {\n\treturn true\n}\n```\n\n```go\ntype GenericTaskError struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r GenericTaskError) Error() string\n```\n\n```go\nfunc (r GenericTaskError) GetTaskId() string\n```\n\n```go\ntype GenericTasksError struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r GenericTasksError) Error() string\n```\n\n```go\nfunc (r GenericTasksError) GetTaskIds() []string\n```\n\n```go\ntype Manager struct {\n\tAgentCache AgentCache\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewManager(resourceOffersDone \u003c-chan DeploymentMap,\n\ttasksToDeploy chan\u003c- Descriptors,\n\treviveOffersTrg chan struct{},\n\tcq *controlcommands.CommandQueue) (taskman *Manager)\n```\n\n```go\nfunc (m *Manager) AcquireTasks(envId uuid.Array, taskDescriptors Descriptors) (err error)\n```\n\n```go\nfunc (m *Manager) BuildDescriptorConstraints(descriptors Descriptors) (cm map[*Descriptor]constraint.Constraints)\n```\n\n```go\nfunc (m *Manager) Cleanup() (killed Tasks, running Tasks, err error)\n```\n\n```go\nfunc (m *Manager) ConfigureTasks(envId uuid.Array, tasks Tasks) error\n```\n\n```go\nfunc (m *Manager) GetTask(id string) *Task\n```\n\n```go\nfunc (m *Manager) GetTaskClass(name string) (b *TaskClass)\n```\n\n```go\nfunc (m *Manager) GetTasks() Tasks\n```\n\n```go\nfunc (m *Manager) GetWantsForDescriptor(descriptor *Descriptor) (r *Wants)\n```\n\n```go\nfunc (m *Manager) KillTasks(taskIds []string) (killed Tasks, running Tasks, err error)\n```\n\n```go\nfunc (m *Manager) NewTaskForMesosOffer(offer *mesos.Offer, descriptor *Descriptor, bindPorts map[string]uint64, executorId mesos.ExecutorID) (t *Task)\n```\nNewTaskForMesosOffer accepts a Mesos offer and a Descriptor and returns a newly constructed Task. This function should only be called by the Mesos scheduler controller when matching role requests with offers (matchRoles). The new role is not assigned to an environment and comes without a roleClass function, as those two are filled out later on by Manager.AcquireTasks.\n\n```go\nfunc (m *Manager) RefreshClasses() (err error)\n```\n\n```go\nfunc (m *Manager) ReleaseTasks(envId uuid.Array, tasks Tasks) error\n```\n\n```go\nfunc (m *Manager) TaskCount() int\n```\n\n```go\nfunc (m *Manager) TransitionTasks(envId uuid.Array, tasks Tasks, src string, event string, dest string, commonArgs controlcommands.PropertyMap) error\n```\n\n```go\nfunc (m *Manager) UpdateTaskState(taskId string, state string)\n```\n\n```go\nfunc (m *Manager) UpdateTaskStatus(status *mesos.TaskStatus)\n```\n\n```go\ntype Range struct {\n\tBegin uint64 `json:\"begin\" yaml:\"begin\"`\n\tEnd   uint64 `json:\"end\"   yaml:\"end\"`\n}\n```\n\n```go\ntype Ranges []Range\n```\n\n```go\nfunc (this Ranges) Equals(other Ranges) (response bool)\n```\n\n```go\ntype ResourceWants struct {\n\tCpu    *float64 `yaml:\"cpu\"`\n\tMemory *float64 `yaml:\"memory\"`\n\tPorts  Ranges   `yaml:\"ports\"`\n}\n```\n\n```go\nfunc (rw *ResourceWants) UnmarshalYAML(unmarshal func(interface{}) error) (err error)\n```\n\n```go\ntype Resources mesos.Resources\n```\n\n```go\nfunc (r Resources) Satisfy(wants *Wants) bool\n```\n\n```go\ntype State int\n```\n\n```go\nconst (\n\tUNKNOWN State = iota\n\tSTANDBY\n\tCONFIGURED\n\tRUNNING\n\tERROR\n\tDONE\n\tMIXED\n)\n```\n\n```go\nfunc StateFromString(s string) State\n```\n\n```go\nfunc (s State) String() string\n```\n\n```go\nfunc (s State) X(other State) State\n```\n\n```go\ntype Status uint8\n```\n\n```go\nfunc (s Status) String() string\n```\n\n```go\nfunc (s Status) X(other Status) Status\n```\n\n```go\ntype Task struct {\n\tGetTaskClass func() *TaskClass\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (t Task) BuildPropertyMap(bindMap channel.BindMap) controlcommands.PropertyMap\n```\n\n```go\nfunc (t Task) BuildTaskCommand() (cmd *common.TaskCommandInfo)\n```\nReturns a consolidated CommandInfo for this Task, based on Roles tree and TaskClass.\n\n```go\nfunc (t Task) GetAgentId() string\n```\n\n```go\nfunc (t Task) GetBindPorts() map[string]uint64\n```\n\n```go\nfunc (t *Task) GetClassName() string\n```\n\n```go\nfunc (t Task) GetEnvironmentId() uuid.Array\n```\n\n```go\nfunc (t Task) GetExecutorId() string\n```\n\n```go\nfunc (t Task) GetHostname() string\n```\n\n```go\nfunc (t Task) GetMesosCommandTarget() controlcommands.MesosCommandTarget\n```\n\n```go\nfunc (t *Task) GetName() string\n```\n\n```go\nfunc (t Task) GetOfferId() string\n```\n\n```go\nfunc (t *Task) GetParentRole() interface{}\n```\n\n```go\nfunc (t *Task) GetParentRolePath() string\n```\n\n```go\nfunc (t Task) GetTaskId() string\n```\n\n```go\nfunc (t *Task) GetWantsCPU() float64\n```\n\n```go\nfunc (t *Task) GetWantsMemory() float64\n```\n\n```go\nfunc (t *Task) GetWantsPorts() Ranges\n```\n\n```go\nfunc (t Task) IsLocked() bool\n```\n\n```go\ntype TaskAlreadyReleasedError taskErrorBase\n```\n\n```go\nfunc (r TaskAlreadyReleasedError) Error() string\n```\n\n```go\ntype TaskClass info\n```\n\n```go\ntype TaskError interface {\n\terror\n\tGetTaskId() string\n}\n```\n\n```go\ntype TaskLockedError struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r TaskLockedError) EnvironmentId() uuid.Array\n```\n\n```go\nfunc (r TaskLockedError) Error() string\n```\n\n```go\nfunc (r TaskLockedError) GetTaskId() string\n```\n\n```go\ntype TaskNotFoundError taskErrorBase\n```\n\n```go\nfunc (r TaskNotFoundError) Error() string\n```\n\n```go\ntype Tasks []*Task\n```\n\n```go\nfunc (m Tasks) BuildPropertyMaps(bindMap channel.BindMap) (propMapMap controlcommands.PropertyMapsMap, err error)\n```\n\n```go\nfunc (m Tasks) Contains(filter Filter) (has bool)\n```\n\n```go\nfunc (m Tasks) Filtered(filter Filter) (tasks Tasks)\n```\n\n```go\nfunc (m Tasks) FilteredForClass(className string) (tasks Tasks)\n```\n\n```go\nfunc (m Tasks) GetByTaskId(id string) *Task\n```\n\n```go\nfunc (m Tasks) GetMesosCommandTargets() (receivers []controlcommands.MesosCommandTarget, err error)\n```\n\n```go\ntype TasksDeploymentError tasksErrorBase\n```\n\n```go\nfunc (r TasksDeploymentError) Error() string\n```\n\n```go\ntype TasksError interface {\n\terror\n\tGetTaskIds() []string\n}\n```\n\n```go\ntype Transition struct {\n\tEvt  Event\n\tSrc  State\n\tDst  State\n\tArgs EventArgs\n}\n```\n\n```go\ntype VarMap map[string]string\n```\n\n```go\ntype Wants struct {\n\tCpu         float64\n\tMemory      float64\n\tStaticPorts Ranges\n\tBindPorts   []channel.Inbound\n}\n```\n\n","path":"github.com/AliceO2Group/Control/core/task","name":"task","synopsis":"Package task defines the Task type and its Manager, with the purpose of handling the lifetime of O² Task objects.","isRedistributable":true}
