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 ¶
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.
Click to show internal directories.
Click to hide internal directories.