engine

package
v0.7.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxTgtTargetNumber = 4096
)

Variables

This section is empty.

Functions

func GenerateEngineName

func GenerateEngineName(name string) string

Types

type Engine

type Engine struct {
	EngineName string
	Size       int64
	Binary     string
	Replicas   []string

	VolumeName   string
	LauncherName string
	LauncherAddr string
	ListenIP     string
	Frontend     string
	Backends     []string

	StatusLock *sync.RWMutex
	Listen     string
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(spec *rpc.EngineSpec, launcherAddr string,
	pm rpc.ProcessManagerServiceServer,
	ec VolumeClientService) *Engine

func (*Engine) GetListen

func (e *Engine) GetListen() string

func (*Engine) Log

func (*Engine) ProcessStatus

func (e *Engine) ProcessStatus() *rpc.ProcessStatus

func (*Engine) SetListen

func (e *Engine) SetListen(listen string)

func (*Engine) Start

func (e *Engine) Start() error

func (*Engine) Stop

func (e *Engine) Stop() (*rpc.ProcessResponse, error)

func (*Engine) WaitForDeletion

func (e *Engine) WaitForDeletion() error

func (*Engine) WaitForRunning

func (e *Engine) WaitForRunning() error

type Launcher

type Launcher struct {
	UUID         string
	LauncherName string
	LauncherAddr string
	VolumeName   string
	ListenIP     string
	Size         int64
	Backends     []string
	// contains filtered or unexported fields
}

func NewEngineLauncher

func NewEngineLauncher(spec *rpc.EngineSpec, launcherAddr string,
	engineUpdateCh chan *Launcher,
	processManager rpc.ProcessManagerServiceServer,
	dc longhorndev.DeviceCreator,
	ec VolumeClientService) (*Launcher, error)

func (*Launcher) FrontendShutdown

func (el *Launcher) FrontendShutdown() error

func (*Launcher) FrontendShutdownCallback

func (el *Launcher) FrontendShutdownCallback() (int, error)

func (*Launcher) FrontendStart

func (el *Launcher) FrontendStart(frontend string) error

func (*Launcher) FrontendStartCallback

func (el *Launcher) FrontendStartCallback(tID int) error

func (*Launcher) GetEngineName

func (el *Launcher) GetEngineName() string

func (*Launcher) GetLauncherName

func (el *Launcher) GetLauncherName() string

func (*Launcher) IsSCSIDeviceEnabled

func (el *Launcher) IsSCSIDeviceEnabled() bool

func (*Launcher) IsUpgrading

func (el *Launcher) IsUpgrading() bool

func (*Launcher) Log

func (*Launcher) PrepareUpgrade

func (el *Launcher) PrepareUpgrade(spec *rpc.EngineSpec) (string, error)

func (*Launcher) RPCResponse

func (el *Launcher) RPCResponse() *rpc.EngineResponse

func (*Launcher) Start

func (el *Launcher) Start() error

Start will result in frontendStartCallback() being called automatically.

func (*Launcher) Stop

func (el *Launcher) Stop() error

Stop will result in frontendShutdownCallback() being called automatically.

func (*Launcher) Update

func (el *Launcher) Update()

func (*Launcher) Upgrade

func (el *Launcher) Upgrade() error

func (*Launcher) WaitForDeletion

func (el *Launcher) WaitForDeletion() error

func (*Launcher) WaitForRunning

func (el *Launcher) WaitForRunning() error

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewEngineManager

func NewEngineManager(pm rpc.ProcessManagerServiceServer, processUpdateCh <-chan interface{}, listen string, shutdownCh chan error) (*Manager, error)

func (*Manager) EngineCreate

func (em *Manager) EngineCreate(ctx context.Context, req *rpc.EngineCreateRequest) (ret *rpc.EngineResponse, err error)

EngineCreate will create an engine according to the request If the specified engine name exists already, the creation will fail.

func (*Manager) EngineDelete

func (em *Manager) EngineDelete(ctx context.Context, req *rpc.EngineRequest) (ret *rpc.EngineResponse, err error)

EngineDelete will delete the engine named by the request If the specified engine doesn't exist, the deletion will return with ErrorNotFound

func (*Manager) EngineGet

func (em *Manager) EngineGet(ctx context.Context, req *rpc.EngineRequest) (ret *rpc.EngineResponse, err error)

EngineGet will get the engine named by the request If the specified engine doesn't exist, the deletion will return with ErrorNotFound

func (*Manager) EngineList

func (em *Manager) EngineList(ctx context.Context, req *empty.Empty) (ret *rpc.EngineListResponse, err error)

func (*Manager) EngineLog

func (*Manager) EngineUpgrade

func (em *Manager) EngineUpgrade(ctx context.Context, req *rpc.EngineUpgradeRequest) (ret *rpc.EngineResponse, err error)

EngineUpgrade will upgrade the engine according to the request If the specified engine doesn't exist, the upgrade will return error

func (*Manager) EngineWatch

func (em *Manager) EngineWatch(req *empty.Empty, srv rpc.EngineManagerService_EngineWatchServer) (err error)

func (*Manager) FrontendShutdown

func (em *Manager) FrontendShutdown(ctx context.Context, req *rpc.EngineRequest) (ret *empty.Empty, err error)

func (*Manager) FrontendShutdownCallback

func (em *Manager) FrontendShutdownCallback(ctx context.Context, req *rpc.EngineRequest) (ret *empty.Empty, err error)

func (*Manager) FrontendStart

func (em *Manager) FrontendStart(ctx context.Context, req *rpc.FrontendStartRequest) (ret *empty.Empty, err error)

func (*Manager) FrontendStartCallback

func (em *Manager) FrontendStartCallback(ctx context.Context, req *rpc.EngineRequest) (ret *empty.Empty, err error)

func (*Manager) StartMonitoring

func (em *Manager) StartMonitoring()

type MockDeviceCreator

type MockDeviceCreator struct{}

func (*MockDeviceCreator) NewDevice

func (mdc *MockDeviceCreator) NewDevice(name string, size int64, frontend string) (longhorndev.DeviceService, error)

type MockDeviceService

type MockDeviceService struct {
	*sync.RWMutex
	// contains filtered or unexported fields
}

func (*MockDeviceService) Enabled

func (mds *MockDeviceService) Enabled() bool

func (*MockDeviceService) FinishUpgrade

func (mds *MockDeviceService) FinishUpgrade() error

func (*MockDeviceService) GetEndpoint

func (mds *MockDeviceService) GetEndpoint() string

func (*MockDeviceService) GetFrontend

func (mds *MockDeviceService) GetFrontend() string

func (*MockDeviceService) PrepareUpgrade

func (mds *MockDeviceService) PrepareUpgrade() error

func (*MockDeviceService) SetFrontend

func (mds *MockDeviceService) SetFrontend(frontend string) error

func (*MockDeviceService) Shutdown

func (mds *MockDeviceService) Shutdown() (int, error)

func (*MockDeviceService) Start

func (mds *MockDeviceService) Start(tID int) error

func (*MockDeviceService) UnsetFrontend

func (mds *MockDeviceService) UnsetFrontend()

func (*MockDeviceService) UnsetFrontendCheck

func (mds *MockDeviceService) UnsetFrontendCheck() error

type MockVolumeClient

type MockVolumeClient struct {
	// contains filtered or unexported fields
}

func (*MockVolumeClient) VolumeFrontendShutdown

func (mc *MockVolumeClient) VolumeFrontendShutdown(addr, launcherName string) error

func (*MockVolumeClient) VolumeFrontendStart

func (mc *MockVolumeClient) VolumeFrontendStart(addr, launcherName, frontend string) error

type VolumeClient

type VolumeClient struct{}

func (*VolumeClient) VolumeFrontendShutdown

func (ec *VolumeClient) VolumeFrontendShutdown(addr, launcherName string) error

func (*VolumeClient) VolumeFrontendStart

func (ec *VolumeClient) VolumeFrontendStart(addr, launcherName, frontend string) error

type VolumeClientService

type VolumeClientService interface {
	VolumeFrontendStart(addr, launcherName, frontend string) error
	VolumeFrontendShutdown(addr, launcherName string) error
}

Jump to

Keyboard shortcuts

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