Documentation
¶
Index ¶
Constants ¶
View Source
const ( SuccessCode = 0 ErrorCode = -9999 )
View Source
const ClusterKeyPrefix = "devfeel/rockman/"
View Source
const DefaultLeaderCheckExecutorInterval = 60
View Source
const DefaultTimeLayout = "2006-01-02 15:04:05"
Variables ¶
View Source
var ErrorRpcClientCreate = errors.New("create rpc client error")
Functions ¶
func GetNodeKeyPrefix ¶
Types ¶
type ClusterInfo ¶
type CpuResources ¶
type CpuResources []*ResourceInfo
func (CpuResources) Len ¶
func (rs CpuResources) Len() int
func (CpuResources) Less ¶
func (rs CpuResources) Less(i, j int) bool
func (CpuResources) Swap ¶
func (rs CpuResources) Swap(i, j int)
type ExecutorInfo ¶
type ExecutorInfo struct {
TaskConfig *TaskConfig
Worker *NodeInfo
}
func (*ExecutorInfo) Json ¶
func (e *ExecutorInfo) Json() string
func (*ExecutorInfo) LoadFromJson ¶
func (e *ExecutorInfo) LoadFromJson(json string) error
type JobResources ¶
type JobResources []*ResourceInfo
func (JobResources) Len ¶
func (rs JobResources) Len() int
func (JobResources) Less ¶
func (rs JobResources) Less(i, j int) bool
func (JobResources) Swap ¶
func (rs JobResources) Swap(i, j int)
type LoadResources ¶
type LoadResources []*ResourceInfo
func (LoadResources) Len ¶
func (rs LoadResources) Len() int
func (LoadResources) Less ¶
func (rs LoadResources) Less(i, j int) bool
func (LoadResources) Swap ¶
func (rs LoadResources) Swap(i, j int)
type MemoryResources ¶
type MemoryResources []*ResourceInfo
func (MemoryResources) Len ¶
func (rs MemoryResources) Len() int
func (MemoryResources) Less ¶
func (rs MemoryResources) Less(i, j int) bool
func (MemoryResources) Swap ¶
func (rs MemoryResources) Swap(i, j int)
type NodeInfo ¶
type NodeInfo struct {
NodeID string
Cluster string
Host string
Port string
OuterHost string
OuterPort string
Executors []string
IsMaster bool
IsWorker bool
IsOnline bool
}
func (*NodeInfo) GetEmptyResource ¶
func (n *NodeInfo) GetEmptyResource() *ResourceInfo
func (*NodeInfo) GetNodeKey ¶
func (*NodeInfo) LoadFromJson ¶
type ResourceInfo ¶
type ResourceInfo struct {
EndPoint string
CpuRate int //cpu rate, refresh per 1 minute
MemoryRate int //memory rate, refresh per 1 minute
TaskCount int //job count
LoadValue int //load value = cpu * 30 + memory * 30 + jobs * 40
}
func (*ResourceInfo) RefreshLoadValue ¶
func (r *ResourceInfo) RefreshLoadValue() int
refreshLoadValue refresh resource's load value
type Result ¶
func ErrorResult ¶
func FailedResult ¶
func SuccessResult ¶
func SuccessResult() *Result
type TaskConfig ¶
type TaskConfig struct {
TaskID string
TaskType string
IsRun bool
Handler task.TaskHandle `json:"-"`
DueTime int64
Interval int64
Express string
TaskData interface{}
HAFlag bool //HA flag, if set true, leader will watch it, when it offline will resubmit
TargetType string
TargetConfig interface{}
DistributeType int
}
Click to show internal directories.
Click to hide internal directories.