state

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxRetry int32 = 3

DefaultMaxRetry is the default number of retries.

Variables

View Source
var (
	// SyncJob will create or delete Pods according to Job's spec.
	SyncJob ActionFn
	// KillJob kill all Pods of Job with phase not in podRetainPhase.
	KillJob KillActionFn
)
View Source
var PodRetainPhaseNone = PhaseMap{}

PodRetainPhaseNone stores no phase

View Source
var PodRetainPhaseSoft = PhaseMap{
	v1.PodSucceeded: {},
	v1.PodFailed:    {},
}

PodRetainPhaseSoft stores PodSucceeded and PodFailed Phase

Functions

func TotalTasks

func TotalTasks(job *vcbatch.Job) int32

TotalTasks returns number of tasks in a given volcano job

Types

type ActionFn

type ActionFn func(job *apis.JobInfo, fn UpdateStatusFn) error

ActionFn will create or delete Pods according to Job's spec.

type KillActionFn

type KillActionFn func(job *apis.JobInfo, podRetainPhase PhaseMap, fn UpdateStatusFn) error

KillActionFn kill all Pods of Job with phase not in podRetainPhase.

type PhaseMap

type PhaseMap map[v1.PodPhase]struct{}

PhaseMap to store the pod phases.

type State

type State interface {
	// Execute executes the actions based on current state.
	Execute(act vcbatch.Action) error
}

State interface

func NewState

func NewState(jobInfo *apis.JobInfo) State

NewState gets the state from the volcano job Phase

type UpdateStatusFn

type UpdateStatusFn func(status *vcbatch.JobStatus) (jobPhaseChanged bool)

UpdateStatusFn updates the job status.

Jump to

Keyboard shortcuts

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