environment

package
v0.0.0-...-0f9887e Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2018 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigureTransition

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

CONFIGURE

type EnvManager

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

func NewEnvManager

func NewEnvManager(rm *RoleManager) *EnvManager

func (*EnvManager) Configuration

func (envs *EnvManager) Configuration(environmentId uuid.UUID) EnvironmentCfg

func (*EnvManager) CreateEnvironment

func (envs *EnvManager) CreateEnvironment(roles []string) (uuid.UUID, error)

func (*EnvManager) Environment

func (envs *EnvManager) Environment(environmentId uuid.UUID) (env *Environment, err error)

func (*EnvManager) Ids

func (envs *EnvManager) Ids() (keys []uuid.UUID)

func (*EnvManager) TeardownEnvironment

func (envs *EnvManager) TeardownEnvironment(environmentId uuid.UUID) error

type Environment

type Environment struct {
	Mu sync.RWMutex
	Sm *fsm.FSM
	// contains filtered or unexported fields
}

func (*Environment) Configuration

func (env *Environment) Configuration() EnvironmentCfg

func (*Environment) CreatedWhen

func (env *Environment) CreatedWhen() time.Time

func (*Environment) CurrentState

func (env *Environment) CurrentState() string

func (*Environment) Id

func (env *Environment) Id() uuid.UUID

func (*Environment) Roles

func (env *Environment) Roles() []string

func (*Environment) TryTransition

func (env *Environment) TryTransition(t Transition) (err error)

type EnvironmentCfg

type EnvironmentCfg struct {
	Roles []RoleCfg `json:"roles" binding:"required"`
}

type Range

type Range struct {
	Begin uint64 `json:"begin"`
	End   uint64 `json:"end"`
}

type Ranges

type Ranges []Range

func (Ranges) Equals

func (this Ranges) Equals(other Ranges) (response bool)

type Role

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

func (Role) GetCommand

func (m Role) GetCommand() (cmd *common.CommandInfo)

Returns a consolidated CommandInfo for this Role, based on RoleCfg and RoleClass.

func (Role) GetHostname

func (m Role) GetHostname() string

func (*Role) GetName

func (m *Role) GetName() string

func (Role) GetOfferId

func (m Role) GetOfferId() string

func (*Role) GetRoleClassName

func (m *Role) GetRoleClassName() string

func (Role) GetTaskId

func (m Role) GetTaskId() string

func (*Role) GetWantsCPU

func (m *Role) GetWantsCPU() float64

func (*Role) GetWantsMemory

func (m *Role) GetWantsMemory() float64

func (*Role) GetWantsPorts

func (m *Role) GetWantsPorts() Ranges

func (Role) IsLocked

func (m Role) IsLocked() bool

type RoleCfg

type RoleCfg struct {
	RoleClass         string   `json:"roleClass" binding:"required"`
	CmdExtraEnv       []string `json:"extraEnv,omitempty"`
	CmdExtraArguments []string `json:"extraArgs,omitempty"`
	// contains filtered or unexported fields
}

func (RoleCfg) Equals

func (this RoleCfg) Equals(other *RoleCfg) (response bool)

func (*RoleCfg) EqualsPtr

func (this *RoleCfg) EqualsPtr(other *RoleCfg) (response bool)

type RoleClass

type RoleClass roleInfo

type RoleManager

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

func NewRoleManager

func NewRoleManager(cfgman configuration.Configuration,
	resourceOffersDone <-chan Roles,
	rolesToDeploy chan<- map[string]RoleCfg,
	reviveOffersTrg chan struct{}) *RoleManager

func (*RoleManager) AcquireRoles

func (m *RoleManager) AcquireRoles(envId uuid.Array, roleNames []string) (err error)

func (*RoleManager) ConfigureRoles

func (m *RoleManager) ConfigureRoles(envId uuid.Array, roleNames []string) error

func (*RoleManager) GetRoleClass

func (m *RoleManager) GetRoleClass(name string) (b *RoleClass)

func (*RoleManager) GetRoles

func (m *RoleManager) GetRoles() Roles

func (*RoleManager) RefreshRoleClasses

func (m *RoleManager) RefreshRoleClasses() (err error)

func (*RoleManager) ReleaseRoles

func (m *RoleManager) ReleaseRoles(envId uuid.Array, roleNames []string) error

func (*RoleManager) RoleCount

func (m *RoleManager) RoleCount() int

func (*RoleManager) RoleForMesosOffer

func (m *RoleManager) RoleForMesosOffer(offer *mesos.Offer, roleCfg *RoleCfg) (role *Role)

RoleForMesosOffer accepts a Mesos offer and a RoleCfg and returns a newly constructed Role. This function should only be called by the Mesos scheduler controller when matching role requests with offers (matchRoles). The new role is not assigned to an environment and comes without a roleClass function, as those two are filled out later on by RoleManager.AcquireRoles.

func (*RoleManager) TeardownRoles

func (m *RoleManager) TeardownRoles(roleNames []string) error

type Roles

type Roles map[string]*Role

func (Roles) Contains

func (m Roles) Contains(roleName string) bool

func (Roles) Filtered

func (m Roles) Filtered(filterFunc func(*string, *Role) bool) (roles Roles)

func (Roles) RolesForBase

func (m Roles) RolesForBase(roleClassName string) (roles Roles)

type Transition

type Transition interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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