definition

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

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 (
	UnknowKind 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 // Binded 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