executor

package
v0.0.0-...-41bf3ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2014 License: Apache-2.0 Imports: 13 Imported by: 0

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

View Source
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

type MockedExecutor struct {
	mock.Mock
}

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

Error implements the Error handler.

func (*MockedExecutor) FrameworkMessage

func (e *MockedExecutor) FrameworkMessage(ExecutorDriver, string)

FrameworkMessage implements the FrameworkMessage handler.

func (*MockedExecutor) KillTask

KillTask implements the KillTask handler.

func (*MockedExecutor) LaunchTask

LaunchTask implements the LaunchTask handler.

func (*MockedExecutor) Registered

Registered implements the Registered handler.

func (*MockedExecutor) Reregistered

Reregistered implements the Reregistered handler.

func (*MockedExecutor) Shutdown

func (e *MockedExecutor) Shutdown(ExecutorDriver)

Shutdown implements the Shutdown handler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL