offer

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitEventHandler

func InitEventHandler(
	d *yarpc.Dispatcher,
	parent tally.Scope,
	schedulerClient mpb.SchedulerClient,
	resmgrClient resmgrsvc.ResourceManagerServiceYARPCClient,
	backgroundMgr background.Manager,
	ranker binpacking.Ranker,
	hostMgrConfig config.Config,
	processor watchevent.WatchProcessor,
	hostPoolManager manager.HostPoolManager,
	mesosPlugin *mesosplugins.MesosManager,
)

InitEventHandler initializes the event handler for offers

Types

type EventHandler

type EventHandler interface {
	// Start starts the offer event handler, after which the handler will be
	// ready to process process offer events from an Mesos inbound.
	// Offers sent to the handler before `Start()` could be silently discarded.
	Start() error

	// Stop stops the offer event handlers and clears cached offers in pool.
	// Offers sent to the handler after `Stop()` could be silently discarded.
	Stop() error

	// GetOfferPool returns the underlying Pool holding the offers.
	GetOfferPool() offerpool.Pool

	// Get the handler for eventstream
	GetEventStreamHandler() *eventstream.Handler

	// SetHostPoolManager set host pool manager in the event handler.
	// It should be called during event handler initialization.
	SetHostPoolManager(manager manager.HostPoolManager)
}

EventHandler defines the interface for offer event handler that is called by leader election callbacks

func GetEventHandler

func GetEventHandler() EventHandler

GetEventHandler returns the handler for Mesos offer events. This function assumes the handler has been initialized as part of the InitEventHandler function. TODO: We should start a study of https://github.com/uber-common/inject and see whether we feel comfortable of using it.

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

Metrics tracks various metrics at task state level.

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

type Pruner

type Pruner interface {
	Start()
	Stop()
}

Pruner prunes offers

func NewOfferPruner

func NewOfferPruner(
	pool offerpool.Pool,
	offerPruningPeriod time.Duration,
	metrics *offerpool.Metrics,
) Pruner

NewOfferPruner initiates an instance of OfferPruner

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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