scheduler

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScheduleResult

type ScheduleResult struct {
	Procedure procedure.Procedure
	// The reason that the procedure is generated for.
	Reason string
}

type Scheduler

type Scheduler interface {
	Name() string
	// Schedule will generate procedure based on current cluster snapshot, which will be submitted to ProcedureManager, and whether it is actually executed depends on the current state of ProcedureManager.
	Schedule(ctx context.Context, clusterSnapshot metadata.Snapshot) (ScheduleResult, error)
	// UpdateDeployMode is used to update deployMode for scheduler,
	// DeployMode means that the cluster topology is locked and the mapping between shards and nodes cannot be changed.
	UpdateDeployMode(ctx context.Context, enable bool)
	AddShardAffinityRule(ctx context.Context, rule ShardAffinityRule) error
	RemoveShardAffinityRule(ctx context.Context, shardID storage.ShardID) error
	ListShardAffinityRule(ctx context.Context) (ShardAffinityRule, error)
}

type ShardAffinity added in v1.2.7

type ShardAffinity struct {
	ShardID               storage.ShardID `json:"shardID"`
	NumAllowedOtherShards uint            `json:"numAllowedOtherShards"`
}

type ShardAffinityRule added in v1.2.7

type ShardAffinityRule struct {
	Affinities []ShardAffinity
}

Directories

Path Synopsis
hash
Package hash provides a consistent hashing function with bounded loads.
Package hash provides a consistent hashing function with bounded loads.

Jump to

Keyboard shortcuts

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