scheduler

package
v0.0.0-...-2f8753c Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WAITING = "waiting"
	RUNNING = "running"
)

Variables

This section is empty.

Functions

func AreTaskDagsEqual

func AreTaskDagsEqual(taskDag1, taskDag2 task.TaskRunner) bool

AreTaskDagsEqual ... Figures out if DAGS are equal by performing breadth first search on each dag, sorting the slice of tasks by depth then hash, then comparing the slices for equality.

func GetTaskSchedulerLogFilePath

func GetTaskSchedulerLogFilePath(schedulerName string) string

GetTaskSchedulerLogFilePath ... Gven a TaskScheduler name returns log file path based on settings

func ReCreateStoredDag

func ReCreateStoredDag(RootDAG task.TaskRunner, schedulerUUID string) error

ReCreateStoredDag ... re creates previously scheduled task dag. all tasks in a task dag runn share a scheduler uuid which is the expected

Types

type PlanktonRecord

type PlanktonRecord struct {
	gorm.Model
	TaskName      string
	TaskParams    string
	TaskHash      string
	ParentHash    string
	ChildHashes   string
	SchedulerUUID string
	SchedulerName string
	ExecutionTime float64
	Priority      int
	StartedAt     time.Time
	EndedAt       time.Time
	Version       string
}

PlanktonRecord ... The gorm model used to save meta data for each run, enabled by passing

type Result

type Result struct {
	SchedulerUUID string
	Start         string
	End           string
	Version       string
}

Result ... Object whose data encapsulates a single task dag run

type TaskRunnerDepth

type TaskRunnerDepth struct {
	// contains filtered or unexported fields
}

type TaskScheduler

type TaskScheduler struct {
	Name       string
	RootRunner task.TaskRunner
	Logger     *log.Logger
	CronSpec   string
	// contains filtered or unexported fields
}

TaskScheduler ... The object responsible for taking the root node of a task DAG and running it via the Start() method.

func NewTaskScheduler

func NewTaskScheduler(schedulerName, cronSpec string, RootRunner task.TaskRunner, recordRun bool) (*TaskScheduler, error)

NewTaskScheduler ... Returns new task scheduler

func (*TaskScheduler) LastRecords

func (ts *TaskScheduler) LastRecords() []Result

LastRecords ...

Returns list of all plankton meta data results

func (*TaskScheduler) LastRun

func (ts *TaskScheduler) LastRun() string

LastRun ... Returns date string of latest run

func (*TaskScheduler) ReRun

func (ts *TaskScheduler) ReRun(schedulerUUID string) error

ReRun ...

func (*TaskScheduler) SetStatus

func (ts *TaskScheduler) SetStatus(newStatus string) error

SetStatus ... Used to set TaskScheduler.status in a thread safe way

func (*TaskScheduler) Start

func (ts *TaskScheduler) Start()

Start ...

Entry point for starting the DAG beginning at the RootRunner. Each call to Start() does a number of things:

  1. create new UUID for the scheduler
  2. starts all TaskRunners, taking into account concurrency limit
  3. records output if recordRun is set to true

func (*TaskScheduler) Status

func (ts *TaskScheduler) Status() string

Status ... Used to expose TaskScheduler.status in a thread safe way

Jump to

Keyboard shortcuts

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