14360: Rename Workers -> CountWorkers.
authorTom Clegg <tclegg@veritasgenetics.com>
Fri, 7 Dec 2018 21:01:08 +0000 (16:01 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Fri, 7 Dec 2018 21:01:08 +0000 (16:01 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

lib/dispatchcloud/scheduler/fix_stale_locks.go
lib/dispatchcloud/scheduler/interfaces.go
lib/dispatchcloud/scheduler/run_queue_test.go
lib/dispatchcloud/worker/pool.go

index 985941090d7197c5d7e202c5aad7476f2064a763..264f9e4ec6bbc3747401858a37c3f70b259116c1 100644 (file)
@@ -28,7 +28,7 @@ waiting:
                        // 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.
index 467247ad9ba7070aee6d3efcf25db9d6baac20b7..59700c393523844094a0845922b767cd7da56e31 100644 (file)
@@ -32,7 +32,7 @@ type ContainerQueue interface {
 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
index 35db7052210ef8d1cbeb3d1a9cd86faf6920751f..aff0e227a87e3fd7a2582f8117c555a382513c97 100644 (file)
@@ -72,7 +72,7 @@ func (p *stubPool) 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),
index 37add6d3d6fc83dd3edbda9e8b4de9ff750381d0..2d56e09562852f3906df07a33e6c2c988b9402a8 100644 (file)
@@ -304,8 +304,8 @@ func (wp *Pool) Shutdown(it arvados.InstanceType) bool {
        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()