scheduler

package
v0.0.0-...-9d0dce2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReasonUpdate   = Reason(1)
	ReasonFailed   = Reason(2)
	ReasonObsolete = Reason(3)
)

Variables

View Source
var (
	NotFoundError = errgo.New("not found")
)

Functions

func IsNotFound

func IsNotFound(err error) bool

Types

type ClusterConfig

type ClusterConfig interface {
	ClusterID() string
	VaultConfig
}

type Event

type Event struct {
	UnitName string
	Message  string
}

func NewEvent

func NewEvent(unitName, message string) Event

type Reason

type Reason int

type Scheduler

type Scheduler interface {
	// ValidateCluster checks if the cluster is suitable to run the configured job.
	ValidateCluster() error

	// ConfigureCluster configures the cluster for use by J2.
	ConfigureCluster(config ClusterConfig) error

	// List returns the names of all units on the cluster
	List() ([]Unit, error)

	GetState(Unit) (UnitState, error)

	// HasChanged returns true when the given unit is different on the system (or does not exist on the system)
	HasChanged(UnitData) ([]string, bool, error)

	Stop(events chan Event, reason Reason, units ...Unit) (StopStats, error)
	Destroy(events chan Event, reason Reason, units ...Unit) error

	Start(events chan Event, units UnitDataList) error

	IsUnitForScalingGroup(unit Unit, scalingGroup uint) bool
	IsUnitForJob(unit Unit) bool
	IsUnitForTaskGroup(unit Unit, g jobs.TaskGroupName) bool

	UpdateStopDelay(time.Duration) time.Duration
	UpdateDestroyDelay(time.Duration) time.Duration
}

type StopStats

type StopStats struct {
	StoppedUnits       int
	StoppedGlobalUnits int
}

type Unit

type Unit interface {
	Name() string
}

type UnitData

type UnitData interface {
	Unit
	Content() string
}

type UnitDataList

type UnitDataList interface {
	Len() int
	Get(index int) UnitData
}

type UnitState

type UnitState struct {
	Failed  bool
	Message string
}

type VaultConfig

type VaultConfig interface {
	VaultAddress() string
	VaultCACert() string
	VaultCAPath() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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