group

package
v0.0.0-...-3500608 Latest Latest
Warning

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

Go to latest
Published: May 14, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsController

func AsController(addr plugin.Addressable, g group.Plugin) controller.Controller

AsController returns a Controller, possibly with a scope of the group ID.

func NewGroupPlugin

func NewGroupPlugin(
	instancePlugins InstancePluginLookup,
	flavorPlugins FlavorPluginLookup,
	options group_types.Options) group.Plugin

NewGroupPlugin creates a new group plugin. The LogicalID is optional. It is set when we want to make sure a self-managing cluster manager that is running this group plugin doesn't end up terminating itself during a rolling update.

Types

type FlavorPluginLookup

type FlavorPluginLookup func(plugin_base.Name) (flavor.Plugin, error)

FlavorPluginLookup helps with looking up a flavor plugin by name

type InstancePluginLookup

type InstancePluginLookup func(plugin_base.Name) (instance.Plugin, error)

InstancePluginLookup helps with looking up an instance plugin by name

type Scaled

type Scaled interface {
	// CreateOne creates a single instance in the scaled group.  Parameters may be provided to customize behavior
	// of the instance.
	CreateOne(id *instance.LogicalID)

	// Health inspects the current health state of an instance.
	Health(inst instance.Description) flavor.Health

	// Destroy destroys a single instance.
	Destroy(inst instance.Description, ctx instance.Context) error

	// List returns all instances in the group.
	List() ([]instance.Description, error)

	// Label makes sure all instances in the group are labelled.
	Label() error
}

Scaled is a collection of instances that can be scaled up and down.

type Supervisor

type Supervisor interface {
	util.RunStop

	ID() group.ID

	Size() uint

	PlanUpdate(scaled Scaled, settings groupSettings, newSettings groupSettings) (updatePlan, error)
}

Supervisor watches over a group of instances.

func NewQuorum

func NewQuorum(id group.ID, scaled Scaled, logicalIDs []instance.LogicalID, pollInterval time.Duration) Supervisor

NewQuorum creates a supervisor for a group of instances operating in a quorum.

func NewScalingGroup

func NewScalingGroup(id group.ID, scaled Scaled, size uint, pollInterval time.Duration, maxParallelNum uint) Supervisor

NewScalingGroup creates a supervisor that monitors a group of instances on a provisioner, attempting to maintain a desired size.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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