reserver

package
v0.0.0-...-d2b1cdf Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reserver

type Reserver interface {
	// Adding daemon interface for Reserver
	async.Daemon

	// Reserve reserves the task to host in hostmanager
	Reserve(ctx context.Context) (time.Duration, error)

	// FindCompletedReservations finds the completed reservations and
	// puts them into completed reservation queue
	FindCompletedReservations(ctx context.Context) map[string]*hostsvc.Reservation

	// Cancel reservation cancels the reservation on the provided
	// hosts
	CancelReservations(reservations map[string]*hostsvc.Reservation) error

	// EnqueueReservations enqueues the reservation in the reserver queue
	EnqueueReservation(ctx context.Context, reservation *hostsvc.Reservation) error

	// DequeueCompletedReservation dequeues the completed reservations equal to
	// limit from the completed Reservation queue
	DequeueCompletedReservation(ctx context.Context, limit int) ([]*hostsvc.CompletedReservation, error)
}

Reserver represents a host manager's reservation module. It gets a list of hosts and resmgr task for which we need reservation on the particular host. Reserver will make the reservation on the host by which no other offers will be given for a particular amount of time. After the timeout, Offers will be released and will be given back to placement engines after that tasks can be launched on this host.

func NewReserver

func NewReserver(
	metrics *metrics.Metrics,
	cfg *config.Config,
	offerPool offerpool.Pool) Reserver

NewReserver creates a new reserver which gets the list of reservation from the reservationQueue and based on the availability of the host it chooses the host and put the reservation on the host.

Jump to

Keyboard shortcuts

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