cache

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: Apache-2.0 Imports: 21 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(task *api.TaskInfo) error
}

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

func New

func New(config *rest.Config, schedulerName string) 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
	// contains filtered or unexported fields
}

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) AddSchedulingSpec

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

func (*SchedulerCache) Bind

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

Bind binds task to the target host.

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) DeleteSchedulingSpec

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

func (*SchedulerCache) Evict

func (sc *SchedulerCache) Evict(taskInfo *arbapi.TaskInfo) 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) 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) UpdateSchedulingSpec

func (sc *SchedulerCache) UpdateSchedulingSpec(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