Documentation ¶
Index ¶
Constants ¶
View Source
const ( TaskStatePending = "pending" TaskStateRunning = "running" TaskStateSucceed = "succeed" TaskStateReverting = "reverting" TaskStateFailed = "failed" TaskStateRevertFailed = "revert_failed" TaskStateCancelling = "cancelling" TaskStateCanceled = "canceled" TaskStatePausing = "pausing" TaskStatePaused = "paused" TaskStateRevertPending = "revert_pending" TaskStateReverted = "reverted" )
task state machine
- succeed: pending -> running -> succeed
- failed: pending -> running -> reverting -> reverted/revert_failed
- canceled: pending -> running -> cancelling -> reverting -> reverted/revert_failed
- pause/resume: pending -> running -> pausing -> paused -> running
subtask state machine
- succeed/failed: pending -> running -> succeed/failed
- canceled: pending -> running -> canceled
- rollback: revert_pending -> reverting -> reverted/revert_failed
- pause/resume: pending -> running -> paused -> running
View Source
const ( StepInit int64 = -1 StepOne int64 = 1 StepTwo int64 = 2 )
TaskStep is the step of task.
View Source
const ( // TaskTypeExample is TaskType of Example. TaskTypeExample = "Example" // LoadData is TaskType of LoadData. LoadData = "LoadData" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MinimalTask ¶
type MinimalTask interface {
// IsMinimalTask is a marker to check if it is a minimal task for compiler.
IsMinimalTask()
}
MinimalTask is the minimal task of distribute framework. Each subtask is divided into multiple minimal tasks by scheduler.
type Subtask ¶
type Subtask struct { ID int64 Type string TaskID int64 State string SchedulerID string StartTime uint64 EndTime time.Time Meta []byte }
Subtask represents the subtask of distribute framework. Each task is divided into multiple subtasks by dispatcher.
type Task ¶
type Task struct { ID int64 Key string Type string State string Step int64 DispatcherID string Concurrency uint64 StartTime time.Time StateUpdateTime time.Time Meta []byte Error []byte }
Task represents the task of distribute framework.
func (*Task) IsFinished ¶
IsFinished checks if the task is finished.
Click to show internal directories.
Click to hide internal directories.