Documentation ¶
Index ¶
- Constants
- Variables
- func ClearTaskFlowHandle()
- func GenerateSchedulerNodes(ctx context.Context) ([]*infosync.ServerInfo, error)
- func GetEligibleInstance(serverNodes []*infosync.ServerInfo, pos int) (string, error)
- func RegisterTaskFlowHandle(taskType string, dispatcherHandle TaskFlowHandle)
- type Dispatch
- type MockHandle
- type TaskFlowHandle
- type TaskHandle
Constants ¶
View Source
const ( // DefaultSubtaskConcurrency is the default concurrency for handling subtask. DefaultSubtaskConcurrency = 16 // MaxSubtaskConcurrency is the maximum concurrency for handling subtask. MaxSubtaskConcurrency = 256 )
Variables ¶
View Source
var (
// DefaultDispatchConcurrency is the default concurrency for handling global task.
DefaultDispatchConcurrency = 4
)
Functions ¶
func GenerateSchedulerNodes ¶
func GenerateSchedulerNodes(ctx context.Context) ([]*infosync.ServerInfo, error)
GenerateSchedulerNodes generate a eligible TiDB nodes.
func GetEligibleInstance ¶
func GetEligibleInstance(serverNodes []*infosync.ServerInfo, pos int) (string, error)
GetEligibleInstance gets an eligible instance.
func RegisterTaskFlowHandle ¶
func RegisterTaskFlowHandle(taskType string, dispatcherHandle TaskFlowHandle)
RegisterTaskFlowHandle is used to register the global task handle.
Types ¶
type Dispatch ¶
type Dispatch interface { // Start enables dispatching and monitoring mechanisms. Start() // GetAllSchedulerIDs gets handles the task's all available instances. GetAllSchedulerIDs(ctx context.Context, gTaskID int64) ([]string, error) // Stop stops the dispatcher. Stop() }
Dispatch defines the interface for operations inside a dispatcher.
func NewDispatcher ¶
NewDispatcher creates a dispatcher struct.
type MockHandle ¶
MockHandle is used to mock the Handle.
func (*MockHandle) GetAllSchedulerIDs ¶
GetAllSchedulerIDs implements the Handle.GetAllSchedulerIDs interface.
type TaskFlowHandle ¶
type TaskFlowHandle interface { ProcessNormalFlow(ctx context.Context, h TaskHandle, gTask *proto.Task) (metas [][]byte, err error) ProcessErrFlow(ctx context.Context, h TaskHandle, gTask *proto.Task, receiveErr [][]byte) (meta []byte, err error) }
TaskFlowHandle is used to control the process operations for each global task.
func GetTaskFlowHandle ¶
func GetTaskFlowHandle(taskType string) TaskFlowHandle
GetTaskFlowHandle is used to get the global task handle.
Click to show internal directories.
Click to hide internal directories.