cache

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binder

type Binder interface {
	Bind(task *v1.Pod, hostname string) error
}

type Cache

type Cache interface {
	// Run start informer
	Run(stopCh <-chan struct{})

	// Snapshot deep copy overall cache information into snapshot
	Snapshot() *api.ClusterInfo

	// SchedulerConf return the property of scheduler configuration
	LoadSchedulerConf(path string) (map[string]string, error)

	// WaitForCacheSync waits for all cache synced
	WaitForCacheSync(stopCh <-chan struct{}) bool

	// Bind binds Task to the target host.
	// TODO(jinzhej): clean up expire Tasks.
	Bind(task *api.TaskInfo, hostname string) error

	// Evict evicts the task to release resources.
	Evict(task *api.TaskInfo, reason string) error

	// Backoff puts job in backlog for a while.
	Backoff(job *api.JobInfo, event arbcorev1.Event, reason string) error
}

Cache collects pods/nodes/queues information and provides information snapshot

func New

func New(config *rest.Config, schedulerName string, nsAsQueue bool) Cache

New returns a Cache implementation.

type Evictor

type Evictor interface {
	Evict(pod *v1.Pod) error
}

type SchedulerCache

type SchedulerCache struct {
	sync.Mutex

	Binder  Binder
	Evictor Evictor

	Jobs   map[arbapi.JobID]*arbapi.JobInfo
	Nodes  map[string]*arbapi.NodeInfo
	Queues map[arbapi.QueueID]*arbapi.QueueInfo
	// contains filtered or unexported fields
}

func (*SchedulerCache) AddNamespace

func (sc *SchedulerCache) AddNamespace(obj interface{})

func (*SchedulerCache) AddNode

func (sc *SchedulerCache) AddNode(obj interface{})

func (*SchedulerCache) AddPDB

func (sc *SchedulerCache) AddPDB(obj interface{})

func (*SchedulerCache) AddPod

func (sc *SchedulerCache) AddPod(obj interface{})

func (*SchedulerCache) AddPodGroup

func (sc *SchedulerCache) AddPodGroup(obj interface{})

func (*SchedulerCache) AddQueue

func (sc *SchedulerCache) AddQueue(obj interface{})

func (*SchedulerCache) Backoff

func (sc *SchedulerCache) Backoff(job *arbapi.JobInfo, event arbcorev1.Event, reason string) error

Backoff record event for job

func (*SchedulerCache) Bind

func (sc *SchedulerCache) Bind(taskInfo *arbapi.TaskInfo, hostname string) error

Bind binds task to the target host.

func (*SchedulerCache) DeleteNamespace

func (sc *SchedulerCache) DeleteNamespace(obj interface{})

func (*SchedulerCache) DeleteNode

func (sc *SchedulerCache) DeleteNode(obj interface{})

func (*SchedulerCache) DeletePDB

func (sc *SchedulerCache) DeletePDB(obj interface{})

func (*SchedulerCache) DeletePod

func (sc *SchedulerCache) DeletePod(obj interface{})

func (*SchedulerCache) DeletePodGroup

func (sc *SchedulerCache) DeletePodGroup(obj interface{})

func (*SchedulerCache) DeleteQueue

func (sc *SchedulerCache) DeleteQueue(obj interface{})

func (*SchedulerCache) Evict

func (sc *SchedulerCache) Evict(taskInfo *arbapi.TaskInfo, reason string) error

func (*SchedulerCache) LoadSchedulerConf

func (sc *SchedulerCache) LoadSchedulerConf(path string) (map[string]string, error)

func (*SchedulerCache) Run

func (sc *SchedulerCache) Run(stopCh <-chan struct{})

func (*SchedulerCache) Snapshot

func (sc *SchedulerCache) Snapshot() *arbapi.ClusterInfo

func (*SchedulerCache) String

func (sc *SchedulerCache) String() string

func (*SchedulerCache) UpdateNamespace

func (sc *SchedulerCache) UpdateNamespace(oldObj, newObj interface{})

func (*SchedulerCache) UpdateNode

func (sc *SchedulerCache) UpdateNode(oldObj, newObj interface{})

func (*SchedulerCache) UpdatePDB

func (sc *SchedulerCache) UpdatePDB(oldObj, newObj interface{})

func (*SchedulerCache) UpdatePod

func (sc *SchedulerCache) UpdatePod(oldObj, newObj interface{})

func (*SchedulerCache) UpdatePodGroup

func (sc *SchedulerCache) UpdatePodGroup(oldObj, newObj interface{})

func (*SchedulerCache) UpdateQueue

func (sc *SchedulerCache) UpdateQueue(oldObj, newObj interface{})

func (*SchedulerCache) WaitForCacheSync

func (sc *SchedulerCache) WaitForCacheSync(stopCh <-chan struct{}) bool

Jump to

Keyboard shortcuts

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