Documentation ¶
Overview ¶
Package executor includes the interfaces of the mesos executor and the mesos executor driver, as well as an implementation of the driver.
Index ¶
- Constants
- type Executor
- type ExecutorDriver
- type MesosExecutorDriver
- func (driver *MesosExecutorDriver) Abort() mesosproto.Status
- func (driver *MesosExecutorDriver) Destroy() error
- func (driver *MesosExecutorDriver) Join() mesosproto.Status
- func (driver *MesosExecutorDriver) SendFrameworkMessage(data string) (mesosproto.Status, error)
- func (driver *MesosExecutorDriver) SendStatusUpdate(taskStatus *mesosproto.TaskStatus) (mesosproto.Status, error)
- func (driver *MesosExecutorDriver) Start() (mesosproto.Status, error)
- func (driver *MesosExecutorDriver) Stop() mesosproto.Status
- type MockedExecutor
- func (e *MockedExecutor) Disconnected(ExecutorDriver)
- func (e *MockedExecutor) Error(ExecutorDriver, string)
- func (e *MockedExecutor) FrameworkMessage(ExecutorDriver, string)
- func (e *MockedExecutor) KillTask(ExecutorDriver, *mesosproto.TaskID)
- func (e *MockedExecutor) LaunchTask(ExecutorDriver, *mesosproto.TaskInfo)
- func (e *MockedExecutor) Registered(ExecutorDriver, *mesosproto.ExecutorInfo, *mesosproto.FrameworkInfo, ...)
- func (e *MockedExecutor) Reregistered(ExecutorDriver, *mesosproto.SlaveInfo)
- func (e *MockedExecutor) Shutdown(ExecutorDriver)
Constants ¶
const (
// MesosVersion indicates the supported mesos version.
MesosVersion = "0.20.0"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor interface { Registered(ExecutorDriver, *mesosproto.ExecutorInfo, *mesosproto.FrameworkInfo, *mesosproto.SlaveInfo) Reregistered(ExecutorDriver, *mesosproto.SlaveInfo) Disconnected(ExecutorDriver) LaunchTask(ExecutorDriver, *mesosproto.TaskInfo) KillTask(ExecutorDriver, *mesosproto.TaskID) FrameworkMessage(ExecutorDriver, string) Shutdown(ExecutorDriver) Error(ExecutorDriver, string) }
Executor interface defines all the functions that are needed to implement a mesos executor.
type ExecutorDriver ¶
type ExecutorDriver interface { Start() (mesosproto.Status, error) Stop() mesosproto.Status Abort() mesosproto.Status Join() mesosproto.Status SendStatusUpdate(*mesosproto.TaskStatus) (mesosproto.Status, error) SendFrameworkMessage(string) (mesosproto.Status, error) Destroy() error }
ExecutorDriver interface defines the functions that are needed to implement a mesos executor driver.
type MesosExecutorDriver ¶
type MesosExecutorDriver struct { Executor Executor // contains filtered or unexported fields }
MesosExecutorDriver is a implementation of the ExecutorDriver.
func NewMesosExecutorDriver ¶
func NewMesosExecutorDriver() *MesosExecutorDriver
NewMesosExecutorDriver creates a new mesos executor driver.
func (*MesosExecutorDriver) Abort ¶
func (driver *MesosExecutorDriver) Abort() mesosproto.Status
Abort aborts the driver.
func (*MesosExecutorDriver) Destroy ¶
func (driver *MesosExecutorDriver) Destroy() error
Destroy destroys the driver. No-op for now.
func (*MesosExecutorDriver) Join ¶
func (driver *MesosExecutorDriver) Join() mesosproto.Status
Join blocks the driver until it's either stopped or aborted.
func (*MesosExecutorDriver) SendFrameworkMessage ¶
func (driver *MesosExecutorDriver) SendFrameworkMessage(data string) (mesosproto.Status, error)
SendFrameworkMessage sends a FrameworkMessage to the slave.
func (*MesosExecutorDriver) SendStatusUpdate ¶
func (driver *MesosExecutorDriver) SendStatusUpdate(taskStatus *mesosproto.TaskStatus) (mesosproto.Status, error)
SendStatusUpdate sends a StatusUpdate message to the slave.
func (*MesosExecutorDriver) Start ¶
func (driver *MesosExecutorDriver) Start() (mesosproto.Status, error)
Start starts the driver.
func (*MesosExecutorDriver) Stop ¶
func (driver *MesosExecutorDriver) Stop() mesosproto.Status
Stop stops the driver.
type MockedExecutor ¶
MockedExecutor is used for testing the executor driver.
func NewMockedExecutor ¶
func NewMockedExecutor() *MockedExecutor
NewMockedExecutor returns a mocked executor.
func (*MockedExecutor) Disconnected ¶
func (e *MockedExecutor) Disconnected(ExecutorDriver)
Disconnected implements the Disconnected handler.
func (*MockedExecutor) Error ¶
func (e *MockedExecutor) Error(ExecutorDriver, string)
Error implements the Error handler.
func (*MockedExecutor) FrameworkMessage ¶
func (e *MockedExecutor) FrameworkMessage(ExecutorDriver, string)
FrameworkMessage implements the FrameworkMessage handler.
func (*MockedExecutor) KillTask ¶
func (e *MockedExecutor) KillTask(ExecutorDriver, *mesosproto.TaskID)
KillTask implements the KillTask handler.
func (*MockedExecutor) LaunchTask ¶
func (e *MockedExecutor) LaunchTask(ExecutorDriver, *mesosproto.TaskInfo)
LaunchTask implements the LaunchTask handler.
func (*MockedExecutor) Registered ¶
func (e *MockedExecutor) Registered(ExecutorDriver, *mesosproto.ExecutorInfo, *mesosproto.FrameworkInfo, *mesosproto.SlaveInfo)
Registered implements the Registered handler.
func (*MockedExecutor) Reregistered ¶
func (e *MockedExecutor) Reregistered(ExecutorDriver, *mesosproto.SlaveInfo)
Reregistered implements the Reregistered handler.
func (*MockedExecutor) Shutdown ¶
func (e *MockedExecutor) Shutdown(ExecutorDriver)
Shutdown implements the Shutdown handler.