Documentation
¶
Overview ¶
Package executor defines the Executor interface and provides implementations for running tasks via shell, Python, Docker, Spark, Hadoop, and HDFS.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerConfig ¶
type DockerConfig struct {
Host string // Docker daemon host, defaults to unix socket
APIVersion string // Docker API version
}
DockerConfig configures the Docker executor.
type DockerExecutor ¶
type DockerExecutor struct {
// contains filtered or unexported fields
}
DockerExecutor runs tasks in Docker containers.
func NewDockerExecutor ¶
func NewDockerExecutor(cfg DockerConfig) *DockerExecutor
NewDockerExecutor creates a new Docker executor.
func (*DockerExecutor) Cancel ¶
func (e *DockerExecutor) Cancel(ctx context.Context, taskID string) error
func (*DockerExecutor) Type ¶
func (e *DockerExecutor) Type() string
type Executor ¶
type Executor interface {
// Execute runs the task with the given parameters.
Execute(ctx context.Context, task *dag.Task, params map[string]any) (*Result, error)
// Cancel stops an in-progress task execution.
Cancel(ctx context.Context, taskID string) error
// Validate checks if the task configuration is valid for this executor.
Validate(task *dag.Task) error
// Type returns the executor type identifier.
Type() string
}
Executor is the interface that all task executors must implement.
type HDFSConfig ¶
HDFSConfig configures the HDFS executor.
type HDFSExecutor ¶
type HDFSExecutor struct {
// contains filtered or unexported fields
}
HDFSExecutor performs HDFS file operations via the WebHDFS REST API.
func NewHDFSExecutor ¶
func NewHDFSExecutor(cfg HDFSConfig) *HDFSExecutor
NewHDFSExecutor creates a new HDFS executor.
func (*HDFSExecutor) Type ¶
func (e *HDFSExecutor) Type() string
type HadoopConfig ¶
type HadoopConfig struct {
ResourceManagerURL string // YARN ResourceManager URL
TimelineServerURL string // YARN Timeline Server URL
User string // Hadoop user
}
HadoopConfig configures the Hadoop executor.
type HadoopExecutor ¶
type HadoopExecutor struct {
// contains filtered or unexported fields
}
HadoopExecutor submits and manages Hadoop MapReduce jobs via YARN REST API.
func NewHadoopExecutor ¶
func NewHadoopExecutor(cfg HadoopConfig) *HadoopExecutor
NewHadoopExecutor creates a new Hadoop MapReduce executor.
func (*HadoopExecutor) Cancel ¶
func (e *HadoopExecutor) Cancel(ctx context.Context, taskID string) error
func (*HadoopExecutor) Type ¶
func (e *HadoopExecutor) Type() string
type PythonConfig ¶
type PythonConfig struct {
PythonPath string // Path to python binary, defaults to "python3"
VenvPath string // Optional virtualenv path
}
PythonConfig configures the Python executor.
type PythonExecutor ¶
type PythonExecutor struct {
// contains filtered or unexported fields
}
PythonExecutor runs Python scripts as task execution.
func NewPythonExecutor ¶
func NewPythonExecutor(cfg PythonConfig) *PythonExecutor
NewPythonExecutor creates a new Python executor.
func (*PythonExecutor) Cancel ¶
func (e *PythonExecutor) Cancel(_ context.Context, taskID string) error
func (*PythonExecutor) Type ¶
func (e *PythonExecutor) Type() string
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds available executor implementations.
func DefaultRegistry ¶
func DefaultRegistry() *Registry
DefaultRegistry creates a registry with all built-in executors.
type Result ¶
type Result struct {
Status dag.Status `json:"status"`
Output []byte `json:"output"`
Error error `json:"error,omitempty"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Metrics map[string]float64 `json:"metrics,omitempty"`
ExitCode int `json:"exit_code"`
}
Result contains the outcome of task execution.
type ShellExecutor ¶
type ShellExecutor struct {
// contains filtered or unexported fields
}
ShellExecutor runs shell commands as task execution.
func NewShellExecutor ¶
func NewShellExecutor() *ShellExecutor
NewShellExecutor creates a new shell executor.
func (*ShellExecutor) Cancel ¶
func (e *ShellExecutor) Cancel(_ context.Context, taskID string) error
func (*ShellExecutor) Type ¶
func (e *ShellExecutor) Type() string
type SparkConfig ¶
type SparkConfig struct {
SparkHome string // Path to SPARK_HOME
SparkSubmit string // Path to spark-submit binary
Master string // Spark master URL
ConnectHost string // Spark Connect server host
ConnectPort int // Spark Connect server port
SparkUIURL string // Spark UI URL for monitoring
}
SparkConfig configures the Spark executor.
type SparkExecutor ¶
type SparkExecutor struct {
// contains filtered or unexported fields
}
SparkExecutor submits and manages Spark jobs.
func NewSparkExecutor ¶
func NewSparkExecutor(cfg SparkConfig) *SparkExecutor
NewSparkExecutor creates a new Spark executor.
func (*SparkExecutor) Cancel ¶
func (e *SparkExecutor) Cancel(_ context.Context, taskID string) error
func (*SparkExecutor) Type ¶
func (e *SparkExecutor) Type() string