control

package
v0.0.0-...-f305919 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrJobFinished = errors.New("job is finished")
View Source
var ErrUnknownState = errors.New("unknown state change")

Functions

func GetKeyRanges

func GetKeyRanges(n int) []structs.KeyRange

Types

type Control

type Control struct {
	Address string

	pb.UnimplementedControlServer
	// contains filtered or unexported fields
}

func New

func New(addr string) (*Control, error)

func (*Control) ActiveWorkerPool

func (ctl *Control) ActiveWorkerPool() []*Worker

func (*Control) Heartbeat

func (ctl *Control) Heartbeat(ctx context.Context, req *pb.HeartbeatRequest) (*pb.HeartbeatResponse, error)

func (*Control) PullTask

func (ctl *Control) PullTask(ctx context.Context, req *pb.PullTaskRequest) (*pb.PullTaskResponse, error)

func (*Control) ReportTask

func (ctl *Control) ReportTask(ctx context.Context, req *pb.ReportTaskRequest) (*pb.ReportTaskResponse, error)

func (*Control) SubmitJob

func (ctl *Control) SubmitJob(req *pb.SubmitJobRequest, resp pb.Control_SubmitJobServer) error

type Event

type Event struct {
	Progress  float32
	Message   string
	Timestamp time.Time
}

type FCFSSchedule

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

func (*FCFSSchedule) Dequeue

func (tq *FCFSSchedule) Dequeue() *pb.Task

func (*FCFSSchedule) Empty

func (tq *FCFSSchedule) Empty() bool

func (*FCFSSchedule) Enqueue

func (tq *FCFSSchedule) Enqueue(task *pb.Task)

func (*FCFSSchedule) Peek

func (tq *FCFSSchedule) Peek() *pb.Task

type FCFSScheduleItem

type FCFSScheduleItem struct {
	Task *pb.Task
	Next *FCFSScheduleItem
}

type Job

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

func NewJob

func NewJob(name string, pool []*Worker, s3creds *pb.S3Credentials) *Job

func (*Job) HasScheduledTask

func (j *Job) HasScheduledTask(worker *Worker) bool

HasScheduledTask returns true if there is a task assigned to the worker.

func (*Job) Initialize

func (j *Job) Initialize() error

func (*Job) ScheduleTask

func (j *Job) ScheduleTask(worker *Worker) (*pb.Task, error)

func (*Job) UpdateState

func (j *Job) UpdateState(name string, state pb.TaskState, payload *pb.TaskData)

type OnceSchedule

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

func NewOnceSchedule

func NewOnceSchedule(poolSize int) *OnceSchedule

func (*OnceSchedule) AllScheduled

func (mq *OnceSchedule) AllScheduled() bool

func (*OnceSchedule) Assign

func (mq *OnceSchedule) Assign(i int, t *pb.Task)

func (*OnceSchedule) Index

func (mq *OnceSchedule) Index(i int) *pb.Task

func (*OnceSchedule) Schedule

func (mq *OnceSchedule) Schedule(i int) bool

type Worker

type Worker struct {
	Address string
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(addr string) *Worker

func (*Worker) Assign

func (w *Worker) Assign(task *pb.Task)

func (*Worker) Drop

func (w *Worker) Drop(name string)

func (*Worker) Heartbeat

func (w *Worker) Heartbeat(heartbeat time.Time)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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