Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitJobMgr ¶
func InitJobMgr() (err error)
func InitLogSink ¶
func InitLogSink() (err error)
func InitRegister ¶
func InitRegister() (err error)
Types ¶
type Config ¶
type Config struct { EtcdEndpoints []string `json:"etcdEndpoints"` EtcdDialTimeout int `json:"etcdDialTimeout"` MongodbUri string `json:"MongoDBUri"` MongodbConnectTimeout int `json:"mongoDBConnectTimeout"` JobLogBatchSize int `json:"jobLogBatchSize"` JobLogCommitTimeout int `json:"jobLogCommitTimeout"` }
程序配置
var ( // 单例 G_config *Config )
type Executor ¶
type Executor struct { }
任务执行器
var (
G_executor *Executor
)
func (*Executor) ExecuteJob ¶
func (executor *Executor) ExecuteJob(info *common.JobExecuteInfo)
执行一个任务
type JobLock ¶
type JobLock struct {
// contains filtered or unexported fields
}
分布式锁(txn事务)
func InitJobLock ¶
初始化一把锁
type JobMgr ¶
type JobMgr struct {
// contains filtered or unexported fields
}
任务管理器
var ( // 单例 G_jobMgr *JobMgr )
func (*JobMgr) CreateJobLock ¶
创建任务执行锁
type LogSink ¶
type LogSink struct {
// contains filtered or unexported fields
}
MongoDB存储日志
var ( // 单例 G_logSink *LogSink )
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
注册节点到etcd /cron/workers/{IP地址}
var (
G_register *Register
)
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
任务调度
var (
G_scheduler *Scheduler
)
func (*Scheduler) PushJobEvent ¶
func (*Scheduler) PushJobResult ¶
func (scheduler *Scheduler) PushJobResult(jobResult *common.JobExecuteResult)
回传任务执行结果
func (*Scheduler) TrySchedule ¶
重新计算任务调度状态
func (*Scheduler) TryStartJob ¶
func (scheduler *Scheduler) TryStartJob(jobPlan *common.JobSchedulePlan)
尝试执行任务
Source Files ¶
Click to show internal directories.
Click to hide internal directories.