scheduler

package
v0.0.0-...-1b33b2a Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeySpanNumberScheduler

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

KeySpanNumberScheduler provides a feature that scheduling by the keyspan number

func (*KeySpanNumberScheduler) AlignCapture

func (t *KeySpanNumberScheduler) AlignCapture(captureIDs map[model.CaptureID]struct{})

AlignCapture implements the Scheduler interface

func (*KeySpanNumberScheduler) CalRebalanceOperates

func (t *KeySpanNumberScheduler) CalRebalanceOperates(targetSkewness float64) (
	skewness float64, moveKeySpanJobs map[model.KeySpanID]*model.MoveKeySpanJob,
)

CalRebalanceOperates implements the Scheduler interface

func (*KeySpanNumberScheduler) DistributeKeySpans

func (t *KeySpanNumberScheduler) DistributeKeySpans(keyspanIDs map[model.KeySpanID]model.Ts) map[model.CaptureID]map[model.KeySpanID]*model.KeySpanOperation

DistributeKeySpans implements the Scheduler interface

func (*KeySpanNumberScheduler) ResetWorkloads

func (t *KeySpanNumberScheduler) ResetWorkloads(captureID model.CaptureID, workloads model.TaskWorkload)

ResetWorkloads implements the Scheduler interface

func (*KeySpanNumberScheduler) Skewness

func (t *KeySpanNumberScheduler) Skewness() float64

Skewness implements the Scheduler interface

type Scheduler

type Scheduler interface {
	// ResetWorkloads resets the workloads info of the capture
	ResetWorkloads(captureID model.CaptureID, workloads model.TaskWorkload)
	// AlignCapture makes sure that the workloads of the capture is matched with the specified captureIDs
	AlignCapture(captureIDs map[model.CaptureID]struct{})
	// Skewness returns the skewness
	Skewness() float64
	// CalRebalanceOperates calculates the rebalance operates
	// returns  * the skewness after rebalance
	//          * the move jobs need by rebalance
	CalRebalanceOperates(targetSkewness float64) (
		skewness float64, moveKeySpanJobs map[model.KeySpanID]*model.MoveKeySpanJob)
	// DistributeKeySpans distributes the new keyspans to the captures
	// returns the operations of the new keyspans
	DistributeKeySpans(keyspanIDs map[model.KeySpanID]model.Ts) map[model.CaptureID]map[model.KeySpanID]*model.KeySpanOperation
}

Scheduler is an abstraction for anything that provide the schedule keyspan feature

func NewScheduler

func NewScheduler(tp string) Scheduler

NewScheduler creates a new Scheduler

Jump to

Keyboard shortcuts

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