workerlogic

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerTakeDown

type ContainerTakeDown interface {
	Calculate(state ContainerTakeDownState) []container.IContainer
}

func ProvideOverResourceUsageContainerTakeDown

func ProvideOverResourceUsageContainerTakeDown() ContainerTakeDown

type ContainerTakeDownState

type ContainerTakeDownState struct {
	ContainerBuffer datastructure.Buffer[string, container.IContainer]
	Report          *models.CheckResourceReport // nolint:unused
}

type DistributionResult

type DistributionResult struct {
	CreateContainerToSupportTask bool
}

type OverResourceUsageContainerTakeDown

type OverResourceUsageContainerTakeDown struct{}

func (OverResourceUsageContainerTakeDown) Calculate

func (o OverResourceUsageContainerTakeDown) Calculate(state ContainerTakeDownState) (removeContainer []container.IContainer)

Calculate check the container which one should be shutdown. Don't call stop container in this function, Instead, Just return it and let the caller handle it instead

type WorkerDistributor

type WorkerDistributor interface {
	Distribute(ctx context.Context, task models.Task, workerState WorkerState) DistributionResult
}

func ProvideDelayWorkerDistributor

func ProvideDelayWorkerDistributor(config config.WorkerConfigModel) WorkerDistributor

type WorkerState

type WorkerState struct {
	ContainerCoolDownState datastructure.Buffer[string, time.Time]
	WorkerNodeConfig       config.WorkerConfigModel
	ContainerBuffer        datastructure.Buffer[string, container.IContainer]
}

Jump to

Keyboard shortcuts

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