// If all workers have been contacted, unlock
// containers that aren't claimed by any
// worker.
- unlock = sch.pool.Workers()[worker.StateUnknown] == 0
+ unlock = sch.pool.CountWorkers()[worker.StateUnknown] == 0
case <-timeout.C:
// Give up and unlock the containers, even
// though they might be working.
type WorkerPool interface {
Running() map[string]time.Time
Unallocated() map[arvados.InstanceType]int
- Workers() map[worker.State]int
+ CountWorkers() map[worker.State]int
AtQuota() bool
Create(arvados.InstanceType) error
Shutdown(arvados.InstanceType) bool
p.shutdowns++
return false
}
-func (p *stubPool) Workers() map[worker.State]int {
+func (p *stubPool) CountWorkers() map[worker.State]int {
return map[worker.State]int{
worker.StateBooting: len(p.unalloc) - len(p.idle),
worker.StateIdle: len(p.idle),
return false
}
-// Workers returns the current number of workers in each state.
-func (wp *Pool) Workers() map[State]int {
+// CountWorkers returns the current number of workers in each state.
+func (wp *Pool) CountWorkers() map[State]int {
wp.setupOnce.Do(wp.setup)
wp.mtx.Lock()
defer wp.mtx.Unlock()