Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFrameworkInfo ¶
func SetFrameworkInfo(exec StepExecutor, step proto.Step, resource *proto.StepResource)
SetFrameworkInfo sets the framework info for the StepExecutor.
Types ¶
type StepExecFrameworkInfo ¶
type StepExecFrameworkInfo interface { // GetStep returns the step. GetStep() proto.Step // GetResource returns the expected resource of this step executor. GetResource() *proto.StepResource // contains filtered or unexported methods }
StepExecFrameworkInfo is an interface that should be embedded into the implementation of StepExecutor. It's set by the framework automatically and the implementation can use it to access necessary information. The framework will init it before `StepExecutor.Init`, before that you cannot call methods in this interface.
type StepExecutor ¶
type StepExecutor interface { StepExecFrameworkInfo // Init is used to initialize the environment. // task executor will retry if the returned error is retryable, see // IsRetryableError in TaskExecutor.Extension, else framework will mark random // subtask as failed, to trigger task failure. Init(context.Context) error // RunSubtask is used to run the subtask. // The subtask meta can be updated in place, if no error returned, the subtask // meta will be updated in the task table. RunSubtask(ctx context.Context, subtask *proto.Subtask) error // RealtimeSummary returns the realtime summary of the running subtask by this executor. RealtimeSummary() *SubtaskSummary // Cleanup is used to clean up the environment for this step. // the returned error will not affect task/subtask state, it's only logged, // so don't put code that's prone to error in it. Cleanup(context.Context) error }
StepExecutor defines the executor for subtasks of a task step. the calling sequence is:
Init for every subtask of this step: if RunSubtask failed then break else OnFinished Cleanup
type SubtaskSummary ¶
type SubtaskSummary struct {
RowCount int64
}
SubtaskSummary contains the summary of a subtask.
Click to show internal directories.
Click to hide internal directories.