cache

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: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocatedTaskEvent

type AllocatedTaskEvent struct {
	// contains filtered or unexported fields
}

------------------------ Allocate Event ------------------------

func NewAllocateTaskEvent

func NewAllocateTaskEvent(appId string, taskId string, allocUuid string, nid string) AllocatedTaskEvent

func (AllocatedTaskEvent) GetApplicationId

func (ae AllocatedTaskEvent) GetApplicationId() string

func (AllocatedTaskEvent) GetArgs

func (ae AllocatedTaskEvent) GetArgs() []interface{}

func (AllocatedTaskEvent) GetEvent

func (ae AllocatedTaskEvent) GetEvent() events.TaskEventType

func (AllocatedTaskEvent) GetTaskId

func (ae AllocatedTaskEvent) GetTaskId() string

type Application

type Application struct {
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(appId, queueName, user string, tags map[string]string, scheduler api.SchedulerApi) *Application

func (*Application) AddTask

func (app *Application) AddTask(task *Task)

func (*Application) GetAllocatedTasks

func (app *Application) GetAllocatedTasks() []*Task

func (*Application) GetApplicationId

func (app *Application) GetApplicationId() string

func (*Application) GetApplicationState

func (app *Application) GetApplicationState() string

func (*Application) GetPendingTasks

func (app *Application) GetPendingTasks() []*Task

func (*Application) GetQueue

func (app *Application) GetQueue() string

func (*Application) GetTask

func (app *Application) GetTask(taskId string) (*Task, error)

func (*Application) String

func (app *Application) String() string

type BindTaskEvent

type BindTaskEvent struct {
	// contains filtered or unexported fields
}

------------------------ Bound Event ------------------------

func NewBindTaskEvent

func NewBindTaskEvent(appId string, taskId string) BindTaskEvent

func (BindTaskEvent) GetApplicationId

func (bt BindTaskEvent) GetApplicationId() string

func (BindTaskEvent) GetArgs

func (bt BindTaskEvent) GetArgs() []interface{}

func (BindTaskEvent) GetEvent

func (bt BindTaskEvent) GetEvent() events.TaskEventType

func (BindTaskEvent) GetTaskId

func (bt BindTaskEvent) GetTaskId() string

type CachedSchedulerNodeEvent

type CachedSchedulerNodeEvent struct {
	NodeId    string
	Event     events.SchedulerNodeEventType
	Arguments []interface{}
}

func (CachedSchedulerNodeEvent) GetArgs

func (sn CachedSchedulerNodeEvent) GetArgs() []interface{}

func (CachedSchedulerNodeEvent) GetEvent

func (CachedSchedulerNodeEvent) GetNodeId

func (sn CachedSchedulerNodeEvent) GetNodeId() string

type CompletionHandler

type CompletionHandler struct {
	// contains filtered or unexported fields
}

a application can have one and at most one completion handler, the completion handler determines when a application is considered as stopped, such as for Spark, once driver is succeed, we think this application is completed. this interface can be customized for different type of apps.

type Context

type Context struct {
	// contains filtered or unexported fields
}

context maintains scheduling state, like apps and apps' tasks.

func NewContext

func NewContext(scheduler api.SchedulerApi, configs *conf.SchedulerConf) *Context

Create a new context for the scheduler. This wraps the internal call which really creates the context.

func NewContextInternal

func NewContextInternal(scheduler api.SchedulerApi, configs *conf.SchedulerConf, client client.KubeClient, testMode bool) *Context

Internal create of the scheduler context. Only exposed for testing, not to e used for anything else

func (*Context) AddApplication

func (ctx *Context) AddApplication(app *Application)

for testing only

func (*Context) AddSchedulingEventHandlers

func (ctx *Context) AddSchedulingEventHandlers()

func (*Context) ApplicationEventHandler

func (ctx *Context) ApplicationEventHandler() func(obj interface{})

func (*Context) AssumePod

func (ctx *Context) AssumePod(name string, node string) error

assume a pod will be running on a node, in scheduler, we maintain a cache where stores info for each node what pods are supposed to be running on it. And we keep this cache in-sync between core and the shim. this way, the core can make allocation decisions with consideration of other assumed pods before they are actually bound to the node (bound is slow).

func (*Context) GetApplication

func (ctx *Context) GetApplication(appId string) (*Application, error)

func (*Context) IsPodFitNode

func (ctx *Context) IsPodFitNode(name string, node string) error

evaluate given predicates based on current context

func (*Context) Run

func (ctx *Context) Run(stopCh <-chan struct{})

func (*Context) SchedulerNodeEventHandler

func (ctx *Context) SchedulerNodeEventHandler() func(obj interface{})

func (*Context) SelectApplications

func (ctx *Context) SelectApplications(filter func(app *Application) bool) []*Application

func (*Context) TaskEventHandler

func (ctx *Context) TaskEventHandler() func(obj interface{})

func (*Context) WaitForRecovery

func (ctx *Context) WaitForRecovery(maxTimeout time.Duration) error

type FailApplicationEvent

type FailApplicationEvent struct {
	// contains filtered or unexported fields
}

------------------------ Fail application ------------------------

func NewFailApplicationEvent

func NewFailApplicationEvent(appId string) FailApplicationEvent

func (FailApplicationEvent) GetApplicationId

func (fe FailApplicationEvent) GetApplicationId() string

func (FailApplicationEvent) GetArgs

func (fe FailApplicationEvent) GetArgs() []interface{}

func (FailApplicationEvent) GetEvent

type FailTaskEvent

type FailTaskEvent struct {
	// contains filtered or unexported fields
}

------------------------ Fail Event ------------------------

func NewFailTaskEvent

func NewFailTaskEvent(appId string, taskId string, failedMessage string) FailTaskEvent

func (FailTaskEvent) GetApplicationId

func (fe FailTaskEvent) GetApplicationId() string

func (FailTaskEvent) GetArgs

func (fe FailTaskEvent) GetArgs() []interface{}

func (FailTaskEvent) GetEvent

func (fe FailTaskEvent) GetEvent() events.TaskEventType

func (FailTaskEvent) GetTaskId

func (fe FailTaskEvent) GetTaskId() string

type RejectTaskEvent

type RejectTaskEvent struct {
	// contains filtered or unexported fields
}

------------------------ Reject Event ------------------------

func NewRejectTaskEvent

func NewRejectTaskEvent(appId string, taskId string, rejectedMessage string) RejectTaskEvent

func (RejectTaskEvent) GetApplicationId

func (re RejectTaskEvent) GetApplicationId() string

func (RejectTaskEvent) GetArgs

func (re RejectTaskEvent) GetArgs() []interface{}

func (RejectTaskEvent) GetEvent

func (re RejectTaskEvent) GetEvent() events.TaskEventType

func (RejectTaskEvent) GetTaskId

func (re RejectTaskEvent) GetTaskId() string

type RunApplicationEvent

type RunApplicationEvent struct {
	// contains filtered or unexported fields
}

------------------------ Run application ------------------------

func NewRunApplicationEvent

func NewRunApplicationEvent(appId string, task *Task) RunApplicationEvent

func (RunApplicationEvent) GetApplicationId

func (re RunApplicationEvent) GetApplicationId() string

func (RunApplicationEvent) GetArgs

func (re RunApplicationEvent) GetArgs() []interface{}

func (RunApplicationEvent) GetEvent

type SchedulerNode

type SchedulerNode struct {
	// contains filtered or unexported fields
}

stores info about what scheduler cares about a node

type SimpleApplicationEvent

type SimpleApplicationEvent struct {
	// contains filtered or unexported fields
}

------------------------ SimpleApplicationEvent simples moves application states ------------------------

func NewSimpleApplicationEvent

func NewSimpleApplicationEvent(appId string, eventType events.ApplicationEventType) SimpleApplicationEvent

func (SimpleApplicationEvent) GetApplicationId

func (st SimpleApplicationEvent) GetApplicationId() string

func (SimpleApplicationEvent) GetArgs

func (st SimpleApplicationEvent) GetArgs() []interface{}

func (SimpleApplicationEvent) GetEvent

type SimpleTaskEvent

type SimpleTaskEvent struct {
	// contains filtered or unexported fields
}

------------------------ Simple task Event simply moves task to next state, it has no arguments provided ------------------------

func NewSimpleTaskEvent

func NewSimpleTaskEvent(appId string, taskId string, taskType events.TaskEventType) SimpleTaskEvent

func (SimpleTaskEvent) GetApplicationId

func (st SimpleTaskEvent) GetApplicationId() string

func (SimpleTaskEvent) GetArgs

func (st SimpleTaskEvent) GetArgs() []interface{}

func (SimpleTaskEvent) GetEvent

func (st SimpleTaskEvent) GetEvent() events.TaskEventType

func (SimpleTaskEvent) GetTaskId

func (st SimpleTaskEvent) GetTaskId() string

type SubmitApplicationEvent

type SubmitApplicationEvent struct {
	// contains filtered or unexported fields
}

------------------------ SubmitTask application ------------------------

func NewSubmitApplicationEvent

func NewSubmitApplicationEvent(appId string) SubmitApplicationEvent

func (SubmitApplicationEvent) GetApplicationId

func (se SubmitApplicationEvent) GetApplicationId() string

func (SubmitApplicationEvent) GetArgs

func (se SubmitApplicationEvent) GetArgs() []interface{}

func (SubmitApplicationEvent) GetEvent

type SubmitTaskEvent

type SubmitTaskEvent struct {
	// contains filtered or unexported fields
}

------------------------ SubmitTask Event ------------------------

func NewSubmitTaskEvent

func NewSubmitTaskEvent(appId string, taskId string) SubmitTaskEvent

func (SubmitTaskEvent) GetApplicationId

func (st SubmitTaskEvent) GetApplicationId() string

func (SubmitTaskEvent) GetArgs

func (st SubmitTaskEvent) GetArgs() []interface{}

func (SubmitTaskEvent) GetEvent

func (st SubmitTaskEvent) GetEvent() events.TaskEventType

func (SubmitTaskEvent) GetTaskId

func (st SubmitTaskEvent) GetTaskId() string

type Task

type Task struct {
	// contains filtered or unexported fields
}

func CreateTaskForTest

func CreateTaskForTest(tid string, app *Application, resource *si.Resource,
	client client.KubeClient, schedulerApi api.SchedulerApi) Task

func (*Task) GetTaskPod

func (task *Task) GetTaskPod() *v1.Pod

func (*Task) GetTaskState

func (task *Task) GetTaskState() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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