evictor

package
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: 21 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EvictionReason_name = map[EvictionReason_Type]string{
	EvictionReason_INVALID:          "EvictionReason_INVALID",
	EvictionReason_PREEMPTION:       "EvictionReason_PREEMPTION",
	EvictionReason_HOST_MAINTENANCE: "EvictionReason_HOST_MAINTENANCE",
}

Functions

This section is empty.

Types

type Config

type Config struct {
	// EvictionPeriod is the period to check for tasks for eviction
	EvictionPeriod time.Duration `yaml:"eviction_period"`

	// EvictionDequeueLimit is the limit for the number of tasks evictor
	// dequeues from resource manager and host manager
	EvictionDequeueLimit int `yaml:"eviction_dequeue_limit"`

	// EvictionDequeueTimeout is the timeout value for
	// dequeuing tasks from resource manager and host manager
	EvictionDequeueTimeout int `yaml:"eviction_dequeue_timeout_ms"`
}

Config is Task evictor specific config

type EvictionReason_Type

type EvictionReason_Type int
const (
	// Invalid task eviction reason.
	EvictionReason_INVALID EvictionReason_Type = 0
	// Task is being evicted due to preemption
	EvictionReason_PREEMPTION EvictionReason_Type = 1
	// Task is being evicted due to host maintenance
	EvictionReason_HOST_MAINTENANCE EvictionReason_Type = 2
)

func (EvictionReason_Type) String

func (er EvictionReason_Type) String() string

String returns the string value of eviction reason type

type Evictor

type Evictor interface {
	// Start starts the task Evictor goroutines
	Start() error
	// Stop stops the task Evictor goroutines
	Stop() error
}

Evictor defines the interface of task evictor which kills tasks from the preemption queue of resource manager and maintenance queue of host manager

func New

func New(
	d *yarpc.Dispatcher,
	resMgrClientName string,
	ormStore *ormobjects.Store,
	jobFactory cached.JobFactory,
	goalStateDriver goalstate.Driver,
	hmVersion api.Version,
	config *Config,
	parent tally.Scope,
) Evictor

New create a new Task Evictor

type Metrics

type Metrics struct {
	TaskEvictPreemptionSuccess tally.Counter
	TaskEvictPreemptionFail    tally.Counter

	TaskEvictHostMaintenanceSuccess tally.Counter
	TaskEvictHostMaintenanceFail    tally.Counter

	GetPreemptibleTasksCallDuration tally.Timer

	GetTasksOnDrainingHostsCallDuration tally.Timer
}

Metrics is the struct containing all the counters that track internal state of task evictor.

func NewMetrics

func NewMetrics(scope tally.Scope) *Metrics

NewMetrics returns a new Metrics struct, with all metrics initialized and rooted at the given tally.Scope

Jump to

Keyboard shortcuts

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