diff --git a/nomad/delayheap/delay_heap.go b/lib/delay_heap.go similarity index 99% rename from nomad/delayheap/delay_heap.go rename to lib/delay_heap.go index 4e8ba669c..155583198 100644 --- a/nomad/delayheap/delay_heap.go +++ b/lib/delay_heap.go @@ -1,4 +1,4 @@ -package delayheap +package lib import ( "container/heap" diff --git a/nomad/delayheap/delay_heap_test.go b/lib/delay_heap_test.go similarity index 99% rename from nomad/delayheap/delay_heap_test.go rename to lib/delay_heap_test.go index 3b44acc19..ddf640677 100644 --- a/nomad/delayheap/delay_heap_test.go +++ b/lib/delay_heap_test.go @@ -1,4 +1,4 @@ -package delayheap +package lib import ( "testing" diff --git a/nomad/eval_broker.go b/nomad/eval_broker.go index 01f597104..b3bee7159 100644 --- a/nomad/eval_broker.go +++ b/nomad/eval_broker.go @@ -12,7 +12,7 @@ import ( "github.com/armon/go-metrics" "github.com/hashicorp/nomad/helper/uuid" - "github.com/hashicorp/nomad/nomad/delayheap" + "github.com/hashicorp/nomad/lib" "github.com/hashicorp/nomad/nomad/structs" ) @@ -86,7 +86,7 @@ type EvalBroker struct { // delayHeap is a heap used to track incoming evaluations that are // not eligible to enqueue until their WaitTime - delayHeap *delayheap.DelayHeap + delayHeap *lib.DelayHeap // delayedEvalsUpdateCh is used to trigger notifications for updates // to the delayHeap @@ -142,7 +142,7 @@ func NewEvalBroker(timeout, initialNackDelay, subsequentNackDelay time.Duration, timeWait: make(map[string]*time.Timer), initialNackDelay: initialNackDelay, subsequentNackDelay: subsequentNackDelay, - delayHeap: delayheap.NewDelayHeap(), + delayHeap: lib.NewDelayHeap(), delayedEvalsUpdateCh: make(chan struct{}, 1), } b.stats.ByScheduler = make(map[string]*SchedulerStats) @@ -717,7 +717,7 @@ func (b *EvalBroker) flush() { b.ready = make(map[string]PendingEvaluations) b.unack = make(map[string]*unackEval) b.timeWait = make(map[string]*time.Timer) - b.delayHeap = delayheap.NewDelayHeap() + b.delayHeap = lib.NewDelayHeap() } // evalWrapper satisfies the HeapNode interface