scheduler

package
v0.0.0-...-6e2cd59 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CapacityManager

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

CapacityManager Data structure for keeping track of worker capacities

func NewCapacityManager

func NewCapacityManager(group string, model *SchedulerModel) *CapacityManager

NewCapacityManager returns a new capacity manager

type Event

type Event interface {
	// contains filtered or unexported methods
}

Event for internal communication

type Finish

type Finish struct {
	ID m.JobID
}

Finish message

type Incoming

type Incoming interface {
	// contains filtered or unexported methods
}

Incoming messages from workers to leader

func ProtoToIncoming

func ProtoToIncoming(msg *worker.Message) (Incoming, error)

ProtoToIncoming Convert protobufs to Incoming type message

type InstanceID

type InstanceID string

InstanceID Pod instance ID for identification

type Metrics

type Metrics struct {
	ID        m.JobID
	Code      uint32
	BytesIn   uint64
	BytesOut  uint64
	Latency   time.Duration
	Error     string
	Timestamp time.Time
}

Metrics message

type Outgoing

type Outgoing interface {
	ToProto() *worker.Message
	// contains filtered or unexported methods
}

Outgoing messages to worker from leader

type PodGroup

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

PodGroup indicates kind of pod

func NewPodGroup

func NewPodGroup(group string, clientset *kubernetes.Clientset, model *SchedulerModel, cleanup chan struct{}, failNonExistentGroup bool) (pg *PodGroup, err error)

NewPodGroup Allocates a new podGroup

type PodMetrics

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

PodMetrics maintains prometheus metric collectors.

func NewPodMetrics

func NewPodMetrics(group string, instance InstanceID, totalCapacity uint64) *PodMetrics

NewPodMetrics creates and returns a new prometheus metric collection.

type Scheduler

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

Scheduler stores data belonging to a scheduler.

func NewScheduler

func NewScheduler() *Scheduler

NewScheduler creates a new scheduler using in cluster config.

func (*Scheduler) Register

func (s *Scheduler) Register(group string, instance InstanceID, frequency uint64) (chan Incoming, chan Outgoing, error)

Register registers a WorkerGroup as a PopGroup to the Scheduler.

func (*Scheduler) Stop

func (s *Scheduler) Stop(j m.Job) (err error)

Stop stops a job in a Scheduler

func (*Scheduler) Submit

func (s *Scheduler) Submit(j m.Job) (events chan Event, err error)

Submit submits a job in a Scheduler

type SchedulerModel

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

func NewSchedulerModel

func NewSchedulerModel(config *rest.Config) (*SchedulerModel, error)

Creates a new SchedulerModel using the provided config.

type Start

type Start struct {
	ID         m.JobID
	Frequency  uint64
	Duration   uint64
	HTTPMethod string
	HTTPUrl    string
}

Start message

func (Start) ToProto

func (m Start) ToProto() *worker.Message

ToProto convert Outgoing to protobuf messages

type Stop

type Stop struct {
	ID m.JobID
}

Stop message

func (Stop) ToProto

func (m Stop) ToProto() *worker.Message

ToProto convert Outgoing to protobuf messages

Jump to

Keyboard shortcuts

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