manager

package
v0.0.0-...-6091764 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RUNNING          = mesos_v1.TaskState_TASK_RUNNING
	KILLED           = mesos_v1.TaskState_TASK_KILLED
	LOST             = mesos_v1.TaskState_TASK_LOST
	GONE             = mesos_v1.TaskState_TASK_GONE
	STAGING          = mesos_v1.TaskState_TASK_STAGING
	STARTING         = mesos_v1.TaskState_TASK_STARTING // Default executor never sends this, it sends RUNNING directly.
	UNKNOWN          = mesos_v1.TaskState_TASK_UNKNOWN
	UNREACHABLE      = mesos_v1.TaskState_TASK_UNREACHABLE
	FINISHED         = mesos_v1.TaskState_TASK_FINISHED
	DROPPED          = mesos_v1.TaskState_TASK_DROPPED
	FAILED           = mesos_v1.TaskState_TASK_FAILED
	ERROR            = mesos_v1.TaskState_TASK_ERROR
	GONE_BY_OPERATOR = mesos_v1.TaskState_TASK_GONE_BY_OPERATOR
	KILLING          = mesos_v1.TaskState_TASK_KILLING
)

Consts for mesos states.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupInfo

type GroupInfo struct {
	GroupName string
	InGroup   bool
}

type Task

type Task struct {
	Info      *mesos_v1.TaskInfo
	State     mesos_v1.TaskState
	Filters   []task.Filter
	Retry     *retry.TaskRetry
	Instances int
	IsKill    bool
	GroupInfo GroupInfo
	Strategy  task.Strategy
	// contains filtered or unexported fields
}

Used to hold information about task states in the task manager. Task and its fields should be public so that we can encode/decode this.

func NewTask

func NewTask(i *mesos_v1.TaskInfo, s mesos_v1.TaskState, f []task.Filter, r *retry.TaskRetry, n int, g GroupInfo) *Task

func (*Task) Decode

func (t *Task) Decode(data []byte) (*Task, error)

Decode Decodes task data back into the task type.

func (*Task) Encode

func (t *Task) Encode() ([]byte, error)

Encode encodes the task for transport.

func (*Task) Reschedule

func (t *Task) Reschedule(revive chan *Task)

type TaskManager

type TaskManager interface {
	Add(...*Task) error
	Restore(*Task)
	Delete(...*Task) error
	Get(*string) (*Task, error)
	GetGroup(*Task) ([]*Task, error)
	GetById(id *mesos_v1.TaskID) (*Task, error)
	HasTask(*mesos_v1.TaskInfo) bool
	Update(...*Task) error
	AllByState(state mesos_v1.TaskState) ([]*Task, error)
	TotalTasks() int
	All() ([]*Task, error)
}

Task manager holds information about tasks coming into the framework from the API It can set the state of a task. How the implementation holds/handles those tasks is up to the end user.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL