definition

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: BSD-3-Clause Imports: 5 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model int
const (
	Normal Model = iota
	Stream
)

type Scheduler

type Scheduler struct {
	ID            string
	LastHeartbeat int64
	Enabled       bool // Whether it should begin to schedule
}

func (*Scheduler) String

func (s *Scheduler) String() string

type Statistics

type Statistics struct {
	LastFetchTime     int64
	SelectCount       int64
	SelectItemCount   int64
	OtherCompareCount int64
	ExecuteSuccCount  int64 // concurrent
	ExecuteFailCount  int64 // concurrent
	ExecuteSpendTime  int64 // concurrent
}

func (*Statistics) Execute

func (s *Statistics) Execute(succ bool, cost int64)

func (*Statistics) Select

func (s *Statistics) Select(cnt int64)

type Strategy

type Strategy struct {
	ID                   string
	IPList               []string // Which can be scheduled on
	MaxOnSingleScheduler int      // Max workers can be created on the same scheduler
	Total                int      // Total workers should be created
	Kind                 StrategyKind
	Bind                 string // resource name or type name to bind, cooperate with Kind
	Parameter            string
	Enabled              bool // Whether it should begin to schedule

	// format  0     *     *     *     *     ?
	//         sec   min   hour  day   month week
	CronBegin, CronEnd string

	// Interval for FuncWorker
	Extra map[string]string
}

func (*Strategy) String

func (s *Strategy) String() string

type StrategyKind

type StrategyKind int
const (
	UnknownKind StrategyKind = iota
	SimpleKind
	FuncKind
	TaskKind
)

type StrategyRuntime

type StrategyRuntime struct {
	SchedulerID  string
	StrategyID   string
	CreateAt     int64
	Num          int
	RequestedNum int
}

func (*StrategyRuntime) String

func (s *StrategyRuntime) String() string

type Task

type Task struct {
	ID             string
	IntervalNoData int // Whether to delay specified time (millis) if no data selected
	Interval       int // Whether to delay specified time (millis) if something are selected out
	FetchCount     int
	BatchCount     int // If implement TaskBatch the maximum tasks in one call
	ExecutorCount  int // 1 selector -> N executor(s)
	Model          Model
	Parameter      string // Parameter of task
	Bind           string // Bond to registry
	Items          []TaskItem
	MaxTaskItems   int // max task items per Worker

	// Interval of heartbeat, in millis
	HeartbeatInterval int
	// Timeout to be death, in millis
	DeathTimeout int
}

func (*Task) String

func (t *Task) String() string

type TaskAssignment

type TaskAssignment struct {
	StrategyID         string
	TaskID             string
	ItemID             string
	RuntimeID          string
	RequestedRuntimeID string
	Parameter          string
}

func (*TaskAssignment) String

func (assign *TaskAssignment) String() string

type TaskItem

type TaskItem struct {
	ID        string
	Parameter string
}

TaskItem represents definition of partition in scheduling. A legal Worker must be assigned at least 1 TaskItem.

func (*TaskItem) String

func (item *TaskItem) String() string

type TaskRuntime

type TaskRuntime struct {
	ID            string
	Version       int64
	Createtime    int64
	LastHeartbeat int64
	NextRunnable  int64 // Zero indicating running
	Statistics    Statistics

	// Redundant fields which can be verified on console or other tools
	IP            string
	Hostname      string
	ExecutorCount int
	SchedulerID   string
	StrategyID    string
	OwnSign       string
	TaskID        string
	Bind          string
}

Jump to

Keyboard shortcuts

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