-// Map maps queued containers onto unallocated workers in priority
-// order, creating new workers if needed. It locks containers that can
-// be mapped onto existing/pending workers, and starts them if
-// possible.
-//
-// Map unlocks any containers that are locked but can't be
-// mapped. (For example, this happens when the cloud provider reaches
-// quota/capacity and a previously mappable container's priority is
-// surpassed by a newer container.)
-//
-// If it encounters errors while creating new workers, Map shuts down
-// idle workers, in case they are consuming quota.
-//
-// Map should not be called without first calling FixStaleLocks.
-//
-// FixStaleLocks()
-// for {
-// Map()
-// Sync()
-// }
-func Map(logger logrus.FieldLogger, queue ContainerQueue, pool WorkerPool) {
- unsorted, _ := queue.Entries()
+func (sch *Scheduler) runQueue() {
+ unsorted, _ := sch.queue.Entries()