ptoa

package
Version: v0.0.0-...-a69e935 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinRollbackJobUpdateDetails

func JoinRollbackJobUpdateDetails(d1, d2 *api.JobUpdateDetails) *api.JobUpdateDetails

JoinRollbackJobUpdateDetails joins two updates which together represent an update followed by a manually rollback. Assumes that both updates have the same update id.

func NewConfigGroup

func NewConfigGroup(
	jobSummary *stateless.JobSummary,
	podSpec *pod.PodSpec,
	instanceIDList []uint32,
) (*api.ConfigGroup, error)

NewConfigGroup gets new config group for provided instance ranges and aurora task config

func NewConfigGroupWithoutTaskConfig

func NewConfigGroupWithoutTaskConfig(
	instanceIDRange []*pod.InstanceIDRange,
) []*api.ConfigGroup

NewConfigGroupWithoutTaskConfig returns a list of ConfigGroup without TaskConfig field based on input InstanceIDRange from Peloton. If the input is empty, nil will be returned.

func NewConfigSummary

func NewConfigSummary(
	jobSummary *stateless.JobSummary,
	podInfos []*pod.PodInfo,
) (*api.ConfigSummary, error)

NewConfigSummary returns aurora config summary for provided list of peloton pod infos

func NewConstraints

func NewConstraints(constraint *pod.Constraint) ([]*api.Constraint, error)

NewConstraints creates one or many Constraint objects (either ValueConstraint or LimitConstraint) based on input peloton pod.Constraint.

func NewIdentity

func NewIdentity(user string) *api.Identity

NewIdentity creates an Identity object.

func NewJobConfiguration

func NewJobConfiguration(
	jobSummary *stateless.JobSummary,
	podSpec *pod.PodSpec,
	activeOnly bool,
) (*api.JobConfiguration, error)

NewJobConfiguration creates a JobConfiguration object.

func NewJobInstanceUpdateEvent

func NewJobInstanceUpdateEvent(
	instanceID uint32,
	e *stateless.WorkflowEvent,
	d *opaquedata.Data,
) (*api.JobInstanceUpdateEvent, error)

NewJobInstanceUpdateEvent returns a new instance update event from peloton instance update event

func NewJobKey

func NewJobKey(jobName string) (*api.JobKey, error)

NewJobKey creates Aurora JobKey from Peloton job name ("<role>/<environment>/<job_name>")

func NewJobSummary

func NewJobSummary(
	jobSummary *stateless.JobSummary,
	podSpec *pod.PodSpec,
) (*api.JobSummary, error)

NewJobSummary creates a JobSummary object.

func NewJobUpdateAction

func NewJobUpdateAction(
	s stateless.WorkflowState,
	d *opaquedata.Data,
) (*api.JobUpdateAction, error)

NewJobUpdateAction returns the job update action for aurora from peloton workflow state

func NewJobUpdateDetails

func NewJobUpdateDetails(
	k *api.JobKey,
	prevWorkflow *stateless.WorkflowInfo,
	workflow *stateless.WorkflowInfo,
) (*api.JobUpdateDetails, error)

NewJobUpdateDetails converts a workflow into JobUpdateDetails.

func NewJobUpdateEvent

func NewJobUpdateEvent(
	e *stateless.WorkflowEvent,
	d *opaquedata.Data,
) (*api.JobUpdateEvent, error)

NewJobUpdateEvent returns aurora job update event from peloton job update event

func NewJobUpdateInstructions

func NewJobUpdateInstructions(
	prevWorkflow *stateless.WorkflowInfo,
	workflow *stateless.WorkflowInfo,
) (*api.JobUpdateInstructions, error)

NewJobUpdateInstructions gets new job update instructions Since Aggregator ignores task config, it is not set.

func NewJobUpdateSettings

func NewJobUpdateSettings(u *stateless.UpdateSpec) *api.JobUpdateSettings

NewJobUpdateSettings converts UpdateSpec to aurora JobUpdateSettings.

func NewJobUpdateStatus

func NewJobUpdateStatus(
	s stateless.WorkflowState,
	d *opaquedata.Data,
) (api.JobUpdateStatus, error)

NewJobUpdateStatus translates peloton job update state to aurora job update status.

func NewJobUpdateSummary

func NewJobUpdateSummary(
	k *api.JobKey,
	w *stateless.WorkflowInfo,
) (*api.JobUpdateSummary, error)

NewJobUpdateSummary creates a new aurora job update summary using update info.

func NewRange

func NewRange(instanceIDRange []*pod.InstanceIDRange) []*api.Range

NewRange converts peloton's instance id list to aurora's range

func NewScheduleStatus

func NewScheduleStatus(s pod.PodState) (*api.ScheduleStatus, error)

NewScheduleStatus converts Peloton v1 PodState enum to Aurora ScheduleStatus enum.

func NewScheduledTask

func NewScheduledTask(
	jobSummary *stateless.JobSummary,
	podSpec *pod.PodSpec,
	podEvents []*pod.PodEvent,
) (*api.ScheduledTask, error)

NewScheduledTask creates a ScheduledTask object.

func NewTaskConfig

func NewTaskConfig(
	jobSummary *stateless.JobSummary,
	podSpec *pod.PodSpec,
) (*api.TaskConfig, error)

NewTaskConfig returns aurora task config for a provided peloton pod spec

func NewTaskEvent

func NewTaskEvent(e *pod.PodEvent) (*api.TaskEvent, error)

NewTaskEvent converts Peloton PodEvent to Aurora TaskEvent.

func NewTaskTier

func NewTaskTier(s *stateless.SlaSpec) *string

NewTaskTier converts Peloton SlaSpec to Aurora TaskTier string.

Types

type JobInstanceUpdateEventsByTimestamp

type JobInstanceUpdateEventsByTimestamp []*api.JobInstanceUpdateEvent

JobInstanceUpdateEventsByTimestamp sorts instance update events by timestamp.

func (JobInstanceUpdateEventsByTimestamp) Len

func (JobInstanceUpdateEventsByTimestamp) Less

func (JobInstanceUpdateEventsByTimestamp) Swap

type WorkflowsByMaxTS

type WorkflowsByMaxTS []*stateless.WorkflowInfo

WorkflowsByMaxTS sorts stateless.WorkflowInfo by timestamp of latest event

func (WorkflowsByMaxTS) Len

func (w WorkflowsByMaxTS) Len() int

func (WorkflowsByMaxTS) Less

func (w WorkflowsByMaxTS) Less(i, j int) bool

func (WorkflowsByMaxTS) Swap

func (w WorkflowsByMaxTS) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL