distribution

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrResourceAwareDistributorTaskDifferenceJob = errors.New("distribution failed due to jobID is not the same")
	ErrNotEnoughResource                         = errors.New("no available node that have enough resource to run this task")
)

Functions

This section is empty.

Types

type Distributor

type Distributor interface {
	Distribute(ctx context.Context, nodes []NodeMapper, tasks []models.Task) ([]models.Task, []models.DistributeError, error)
}

func ProvideResourceAwareDistributor added in v0.0.5

func ProvideResourceAwareDistributor(config config.ResourceAwareDistributorConfigModel, meter metric.Meter, taskService service.Task) Distributor

func ProvideRoundRobinDistributor

func ProvideRoundRobinDistributor(meter metric.Meter) Distributor

type DistributorMapper added in v0.0.5

type DistributorMapper interface {
	GetDistributor(name models.DistributorName) (Distributor, bool)
}

func ProvideDistributorMapper added in v0.0.5

func ProvideDistributorMapper(resourceAwareDistributorConfig config.ResourceAwareDistributorConfigModel, metric metric.Meter, taskService service.Task) DistributorMapper

type NodeMapper

type NodeMapper struct {
	NodeEntry         models.NodeEntry
	GRPCConnection    proto.WorkerNodeClient
	AvailableResource models.AvailableResource
	Logger            *logrus.Entry
}

type ResourceAwareDistributor added in v0.0.5

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

func (ResourceAwareDistributor) Distribute added in v0.0.5

func (r ResourceAwareDistributor) Distribute(ctx context.Context, nodes []NodeMapper, tasks []models.Task) (successTask []models.Task, distributionError []models.DistributeError, err error)

type RoundRobinDistributor

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

func (RoundRobinDistributor) Distribute

func (r RoundRobinDistributor) Distribute(ctx context.Context, nodes []NodeMapper, tasks []models.Task) (successTask []models.Task, distributionError []models.DistributeError, err error)

Jump to

Keyboard shortcuts

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