common

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: 3 Imported by: 0

Documentation

Overview

Package common provides common structure/interface/errors used throughout jobmgr. This package should not depend on any other packages in jobmgr.

Index

Constants

View Source
const (
	AgentIDField              = "AgentID"
	CompletionTimeField       = "CompletionTime"
	ConfigVersionField        = "ConfigVersion"
	DesiredConfigVersionField = "DesiredConfigVersion"
	DesiredHostField          = "DesiredHost"
	DesiredMesosTaskIDField   = "DesiredMesosTaskId"
	FailureCountField         = "FailureCount"
	GoalStateField            = "GoalState"
	HealthyField              = "Healthy"
	HostField                 = "Host"
	MesosTaskIDField          = "MesosTaskId"
	MessageField              = "Message"
	PortsField                = "Ports"
	PrevMesosTaskIDField      = "PrevMesosTaskId"
	ReasonField               = "Reason"
	ResourceUsageField        = "ResourceUsage"
	RevisionField             = "Revision"
	StartTimeField            = "StartTime"
	StateField                = "State"
	VolumeIDField             = "VolumeID"
	TerminationStatusField    = "TerminationStatus"
)

Name of the fields in pbtask.RuntimeInfo, which is used by job/task cache update request. This list is maintained in sorted order.

View Source
const (
	// MaxConcurrencyErrorRetry indicates the maximum number of times to retry
	// if a concurrency error is received during optimistic concurrency
	// control when writing to the cache.
	MaxConcurrencyErrorRetry = 5

	// MaxSystemFailureAttempts indicates the maximum retries on mesos
	// system failures
	MaxSystemFailureAttempts = 4
)
View Source
const (
	// DummyConfigVersion is the config version of the dummy config which is used
	// for job creation. Config with this version means that the config has nothing,
	// and is used merely as a placeholder.
	DummyConfigVersion = 0
)

Variables

View Source
var InstanceAvailability_name = map[InstanceAvailability_Type]string{
	InstanceAvailability_INVALID:     "InstanceAvailability_INVALID",
	InstanceAvailability_AVAILABLE:   "InstanceAvailability_AVAILABLE",
	InstanceAvailability_KILLED:      "InstanceAvailability_KILLED",
	InstanceAvailability_DELETED:     "InstanceAvailability_DELETED",
	InstanceAvailability_UNAVAILABLE: "InstanceAvailability_UNAVAILABLE",
}
View Source
var InvalidEntityVersionError = yarpcerrors.AbortedErrorf("unexpected entity version")

InvalidEntityVersionError is used when the entity version provided is different from the entity version passed in

View Source
var UnexpectedVersionError = yarpcerrors.AbortedErrorf("operation aborted due to unexpected version")

UnexpectedVersionError is used when an operation fails because existing version is different from the version of object passed in

Functions

This section is empty.

Types

type InstanceAvailability_Type

type InstanceAvailability_Type int32

instance availability type. It is used to determine the type of instance availability in instance availability calculation for SLA Aware pod kill

const (
	// Invalid instance availability
	InstanceAvailability_INVALID InstanceAvailability_Type = 0
	// instance is available - RUNNING and HEALTHY (if health check defined)
	InstanceAvailability_AVAILABLE InstanceAvailability_Type = 1
	// instance has been killed (deadline-exceeded, by user, etc) or preempted
	InstanceAvailability_KILLED InstanceAvailability_Type = 2
	// instance has been deleted
	InstanceAvailability_DELETED InstanceAvailability_Type = 3
	// instance in any state other than the ones specified above is said to be
	// unavailable
	InstanceAvailability_UNAVAILABLE InstanceAvailability_Type = 4
)

type JobConfig

type JobConfig interface {
	// GetInstanceCount returns the instance count
	// in the job config stored in the cache
	GetInstanceCount() uint32
	// GetType returns the type of the job stored in the cache
	GetType() pbjob.JobType
	// GetRespoolID returns the respool id stored in the cache
	GetRespoolID() *peloton.ResourcePoolID
	// GetSLA returns the SLA configuration
	// in the job config stored in the cache
	GetSLA() *pbjob.SlaConfig
	// GetChangeLog returns the changeLog in the job config stored in the cache
	GetChangeLog() *peloton.ChangeLog
	// GetLabels returns the labels of the job stored in the cache
	GetLabels() []*peloton.Label
	// GetName returns the name of the job stored in the cache
	GetName() string
	// GetPlacementStrategy returns the placement strategy
	GetPlacementStrategy() pbjob.PlacementStrategy
}

JobConfig stores the job configurations in cache which is fetched multiple times during normal job/task operations. JobConfig makes the job interface cleaner by having the caller request for the configuration first (which can fail due to Cassandra errors if cache is invalid or not populated yet), and then fetch the needed configuration from the interface. Otherwise, caller needs to deal with context and err for each config related call. The interface exposes get methods only so that the caller cannot overwrite any of these configurations.

type RuntimeDiff

type RuntimeDiff map[string]interface{}

RuntimeDiff to be applied to the runtime struct. key is the field name to be updated, value is the value to be updated to.

Jump to

Keyboard shortcuts

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