scheduler

package
v0.0.0-...-4b22ae8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockPlacementConstrainer

type MockPlacementConstrainer struct {
	ResourceList map[resModel.ResourceKey]model.ExecutorID
}

MockPlacementConstrainer uses a resource executor binding map to implement PlacementConstrainer

func (*MockPlacementConstrainer) GetPlacementConstraint

func (c *MockPlacementConstrainer) GetPlacementConstraint(
	_ context.Context,
	resourceKey resModel.ResourceKey,
) (resModel.ExecutorID, bool, error)

GetPlacementConstraint implements PlacementConstrainer.GetPlacementConstraint

type PlacementConstrainer

type PlacementConstrainer interface {
	GetPlacementConstraint(
		ctx context.Context,
		resourceKey resModel.ResourceKey,
	) (resModel.ExecutorID, bool, error)
}

PlacementConstrainer describes an object that provides the placement constraint for an external resource.

type Scheduler

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

Scheduler is a full set of scheduling management, containing capacity provider, real scheduler and resource placement manager.

func NewScheduler

func NewScheduler(
	infoProvider executorInfoProvider,
	placementConstrainer PlacementConstrainer,
) *Scheduler

NewScheduler creates a new Scheduler instance

func (*Scheduler) ScheduleTask

func (s *Scheduler) ScheduleTask(
	ctx context.Context,
	request *schedModel.SchedulerRequest,
) (*schedModel.SchedulerResponse, error)

ScheduleTask tries to assign an executor to a given task.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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