events

package
v0.0.0-...-f394a37 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEventArgsAsStrings

func GetEventArgsAsStrings(result []string, generic []interface{}) error

Types

type AllStates

type AllStates struct {
	Application *ApplicationStates
	Task        *TaskStates
	Scheduler   *SchedulerStates
	Node        *NodeStates
}

func States

func States() *AllStates

type ApplicationEvent

type ApplicationEvent interface {
	// an application event is associated with an application Id,
	// dispatcher finds out actual application based on this id
	// to handle this event
	GetApplicationId() string

	// the type of this event
	GetEvent() ApplicationEventType

	// an event can have multiple arguments, these arguments will be passed to
	// state machines' callbacks when doing state transition
	GetArgs() []interface{}
}

type ApplicationEventType

type ApplicationEventType string

---------------------------------------------- Application events ----------------------------------------------

const (
	SubmitApplication   ApplicationEventType = "SubmitApplication"
	RecoverApplication  ApplicationEventType = "RecoverApplication"
	AcceptApplication   ApplicationEventType = "AcceptApplication"
	RunApplication      ApplicationEventType = "RunApplication"
	RejectApplication   ApplicationEventType = "RejectApplication"
	CompleteApplication ApplicationEventType = "CompleteApplication"
	FailApplication     ApplicationEventType = "FailApplication"
	KillApplication     ApplicationEventType = "KillApplication"
	KilledApplication   ApplicationEventType = "KilledApplication"
)

type ApplicationStates

type ApplicationStates struct {
	New        string
	Recovering string
	Submitted  string
	Accepted   string
	Running    string
	Rejected   string
	Completed  string
	Killing    string
	Killed     string
	Failed     string
}

type NodeStates

type NodeStates struct {
	New        string
	Recovering string
	Healthy    string
	Unhealthy  string
	Rejected   string
}

type SchedulerEvent

type SchedulerEvent interface {
	// the type of this event
	GetEvent() SchedulerEventType

	// an event can have multiple arguments, these arguments will be passed to
	// state machines' callbacks when doing state transition
	GetArgs() []interface{}
}

type SchedulerEventType

type SchedulerEventType string

-------------------------------------- scheduler events --------------------------------------

const (
	RegisterScheduler        SchedulerEventType = "RegisterScheduler"
	RegisterSchedulerSucceed SchedulerEventType = "RegisterSchedulerSucceed"
	RegisterSchedulerFailed  SchedulerEventType = "RegisterSchedulerFailed"
	RecoverScheduler         SchedulerEventType = "RecoverScheduler"
	RecoverSchedulerSucceed  SchedulerEventType = "RecoverSchedulerSucceed"
	RecoverSchedulerFailed   SchedulerEventType = "RecoverSchedulerFailed"
)

type SchedulerNodeEvent

type SchedulerNodeEvent interface {
	// returns the node Id
	GetNodeId() string

	// the type of this event
	GetEvent() SchedulerNodeEventType

	// an event can have multiple arguments, these arguments will be passed to
	// state machines' callbacks when doing state transition
	GetArgs() []interface{}
}

type SchedulerNodeEventType

type SchedulerNodeEventType string

-------------------------------------- scheduler node events --------------------------------------

const (
	RecoverNode  SchedulerNodeEventType = "RecoverNode"
	NodeAccepted SchedulerNodeEventType = "NodeAccepted"
	NodeRejected SchedulerNodeEventType = "NodeRejected"
)

type SchedulerStates

type SchedulerStates struct {
	New         string
	Registered  string
	Registering string
	Recovering  string
	Running     string
	Draining    string
	Stopped     string
}

type SchedulingEvent

type SchedulingEvent interface {
	GetArgs() []interface{}
}

---------------------------------------------- General event interface ----------------------------------------------

type TaskEvent

type TaskEvent interface {
	// application id which this task belongs to
	GetApplicationId() string

	// a task event must be associated with an application id
	// and a task id, dispatcher need them to dispatch this event
	// to the actual task
	GetTaskId() string

	// type of this event
	GetEvent() TaskEventType

	// an event can have multiple arguments, these arguments will be passed to
	// state machines' callbacks when doing state transition
	GetArgs() []interface{}
}

type TaskEventType

type TaskEventType string

---------------------------------------------- Task events ----------------------------------------------

const (
	SubmitTask    TaskEventType = "SubmitTask"
	TaskAllocated TaskEventType = "TaskAllocated"
	TaskRejected  TaskEventType = "TaskRejected"
	TaskBound     TaskEventType = "TaskBound"
	CompleteTask  TaskEventType = "CompleteTask"
	TaskFail      TaskEventType = "TaskFail"
	KillTask      TaskEventType = "KillTask"
	TaskKilled    TaskEventType = "TaskKilled"
)

type TaskStates

type TaskStates struct {
	Pending    string
	Scheduling string
	Allocated  string
	Rejected   string
	Bound      string
	Killing    string
	Killed     string
	Failed     string
	Completed  string
}

Jump to

Keyboard shortcuts

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