scheduler

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PathStats              = "/stats"
	PathStatsLeader        = "/stats/leader"
	PathStatsDiskMigrating = "/stats/disk/migrating"

	PathTaskAcquire          = "/task/acquire"
	PathTaskReclaim          = "/task/reclaim"
	PathTaskCancel           = "/task/cancel"
	PathTaskComplete         = "/task/complete"
	PathTaskReport           = "/task/report"
	PathTaskRenewal          = "/task/renewal"
	PathInspectComplete      = "/inspect/complete"
	PathInspectAcquire       = "/inspect/acquire"
	PathManualMigrateTaskAdd = "/manual/migrate/task/add"

	PathTaskDetail    = "/task/detail"
	PathTaskDetailURI = PathTaskDetail + "/:type/:id" // "/task/detail/:type/:id"
	PathUpdateVolume  = "/update/vol"
)

defined http server path.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcquireArgs

type AcquireArgs struct {
	IDC string `json:"idc"`
}

type AddManualMigrateArgs

type AddManualMigrateArgs struct {
	Vuid           proto.Vuid `json:"vuid"`
	DirectDownload bool       `json:"direct_download"`
}

func (*AddManualMigrateArgs) Valid

func (args *AddManualMigrateArgs) Valid() bool

type BalanceTasksStat

type BalanceTasksStat struct {
	Enable bool `json:"enable"`
	MigrateTasksStat
}

type Config

type Config struct {
	HostRetry          int   `json:"host_retry"`
	HostSyncIntervalMs int64 `json:"host_sync_interval_ms"`
	rpc.Config
}

Config scheduler config.

type DiskDropTasksStat

type DiskDropTasksStat struct {
	Enable          bool           `json:"enable"`
	DroppingDisks   []proto.DiskID `json:"dropping_disks"`
	TotalTasksCnt   int            `json:"total_tasks_cnt"`
	DroppedTasksCnt int            `json:"dropped_tasks_cnt"`
	MigrateTasksStat
}

type DiskMigratingStats

type DiskMigratingStats struct {
	TotalTasksCnt    int `json:"total_tasks_cnt"`
	MigratedTasksCnt int `json:"migrated_tasks_cnt"`
}

type DiskMigratingStatsArgs

type DiskMigratingStatsArgs struct {
	TaskType proto.TaskType `json:"task_type"`
	DiskID   proto.DiskID   `json:"disk_id"`
}

type DiskRepairTasksStat

type DiskRepairTasksStat struct {
	Enable           bool           `json:"enable"`
	RepairingDisks   []proto.DiskID `json:"repairing_disks"`
	TotalTasksCnt    int            `json:"total_tasks_cnt"`
	RepairedTasksCnt int            `json:"repaired_tasks_cnt"`
	MigrateTasksStat
}

type IInspector

type IInspector interface {
	AcquireInspectTask(ctx context.Context) (ret *proto.VolumeInspectTask, err error)
	CompleteInspectTask(ctx context.Context, args *proto.VolumeInspectRet) (err error)
}

IInspector volume inspect task.

type IManualMigrator

type IManualMigrator interface {
	AddManualMigrateTask(ctx context.Context, args *AddManualMigrateArgs) (err error)
}

IManualMigrator add manual migrate task.

type IMigrator

type IMigrator interface {
	AcquireTask(ctx context.Context, args *AcquireArgs) (ret *proto.MigrateTask, err error)
	RenewalTask(ctx context.Context, args *TaskRenewalArgs) (ret *TaskRenewalRet, err error)
	ReportTask(ctx context.Context, args *TaskReportArgs) (err error)
	ReclaimTask(ctx context.Context, args *OperateTaskArgs) (err error)
	CancelTask(ctx context.Context, args *OperateTaskArgs) (err error)
	CompleteTask(ctx context.Context, args *OperateTaskArgs) (err error)
}

IMigrator scheduler migrate task.

type IScheduler

IScheduler scheduler api interface.

func New

func New(cfg *Config, service cmapi.APIService, clusterID proto.ClusterID) IScheduler

New returns scheduler client.

type ISchedulerStatus

type ISchedulerStatus interface {
	DetailMigrateTask(ctx context.Context, args *MigrateTaskDetailArgs) (detail MigrateTaskDetail, err error)
	DiskMigratingStats(ctx context.Context, args *DiskMigratingStatsArgs) (ret *DiskMigratingStats, err error)
	Stats(ctx context.Context, host string) (ret TasksStat, err error)
	LeaderStats(ctx context.Context) (ret TasksStat, err error)
}

ISchedulerStatus scheduler status.

type IVolumeUpdater

type IVolumeUpdater interface {
	UpdateVolume(ctx context.Context, host string, vid proto.Vid) (err error)
}

IVolumeUpdater volume updater.

func NewVolumeUpdater

func NewVolumeUpdater(cfg *Config) IVolumeUpdater

NewVolumeUpdater returns volume updater client.

type ManualMigrateTasksStat

type ManualMigrateTasksStat struct {
	MigrateTasksStat
}

type MigrateTaskDetail

type MigrateTaskDetail struct {
	Task proto.MigrateTask    `json:"task"`
	Stat proto.TaskStatistics `json:"stat"`
}

MigrateTaskDetail migrate task detail.

type MigrateTaskDetailArgs

type MigrateTaskDetailArgs struct {
	Type proto.TaskType `json:"type"`
	ID   string         `json:"id"`
}

MigrateTaskDetailArgs migrate task detail args.

type MigrateTasksStat

type MigrateTasksStat struct {
	PreparingCnt   int         `json:"preparing_cnt"`
	WorkerDoingCnt int         `json:"worker_doing_cnt"`
	FinishingCnt   int         `json:"finishing_cnt"`
	StatsPerMin    PerMinStats `json:"stats_per_min"`
}

type OperateTaskArgs

type OperateTaskArgs struct {
	IDC      string                `json:"idc"`
	TaskID   string                `json:"task_id"`
	TaskType proto.TaskType        `json:"task_type"`
	Src      []proto.VunitLocation `json:"src"`
	Dest     proto.VunitLocation   `json:"dest"`
	Reason   string                `json:"reason"`
}

OperateTaskArgs for task action.

type PerMinStats

type PerMinStats struct {
	FinishedCnt    string `json:"finished_cnt"`
	ShardCnt       string `json:"shard_cnt"`
	DataAmountByte string `json:"data_amount_byte"`
}

type RunnerStat

type RunnerStat struct {
	Enable        bool     `json:"enable"`
	SuccessPerMin string   `json:"success_per_min"`
	FailedPerMin  string   `json:"failed_per_min"`
	TotalErrCnt   uint64   `json:"total_err_cnt"`
	ErrStats      []string `json:"err_stats"`
}

RunnerStat shard repair and blob delete stat

type TaskRenewalArgs

type TaskRenewalArgs struct {
	IDC string                      `json:"idc"`
	IDs map[proto.TaskType][]string `json:"ids"`
}

type TaskRenewalRet

type TaskRenewalRet struct {
	Errors map[proto.TaskType]map[string]string `json:"errors,omitempty"`
}

type TaskReportArgs

type TaskReportArgs struct {
	TaskType proto.TaskType `json:"task_type"`
	TaskID   string         `json:"task_id"`

	TaskStats            proto.TaskStatistics `json:"task_stats"`
	IncreaseDataSizeByte int                  `json:"increase_data_size_byte"`
	IncreaseShardCnt     int                  `json:"increase_shard_cnt"`
}

type TasksStat

type TasksStat struct {
	DiskRepair    *DiskRepairTasksStat    `json:"disk_repair,omitempty"`
	DiskDrop      *DiskDropTasksStat      `json:"disk_drop,omitempty"`
	Balance       *BalanceTasksStat       `json:"balance,omitempty"`
	ManualMigrate *ManualMigrateTasksStat `json:"manual_migrate,omitempty"`
	VolumeInspect *VolumeInspectTasksStat `json:"volume_inspect,omitempty"`
	ShardRepair   *RunnerStat             `json:"shard_repair"`
	BlobDelete    *RunnerStat             `json:"blob_delete"`
}

type UpdateVolumeArgs

type UpdateVolumeArgs struct {
	Vid proto.Vid `json:"vid"`
}

UpdateVolumeArgs argument of volume to update.

type VolumeInspectTasksStat

type VolumeInspectTasksStat struct {
	Enable         bool   `json:"enable"`
	FinishedPerMin string `json:"finished_per_min"`
	TimeOutPerMin  string `json:"time_out_per_min"`
}

Jump to

Keyboard shortcuts

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