MCPcopy
hub / github.com/kubernetes/client-go / NewHeap

Function NewHeap

tools/cache/heap.go:312–323  ·  view source on GitHub ↗

NewHeap returns a Heap which can be used to queue up items to process.

(keyFn KeyFunc, lessFn LessFunc)

Source from the content-addressed store, hash-verified

310
311// NewHeap returns a Heap which can be used to queue up items to process.
312func NewHeap(keyFn KeyFunc, lessFn LessFunc) *Heap {
313 h := &Heap{
314 data: &heapData{
315 items: map[string]*heapItem{},
316 queue: []string{},
317 keyFunc: keyFn,
318 lessFunc: lessFn,
319 },
320 }
321 h.cond.L = &h.lock
322 return h
323}

Callers 13

TestHeapBasicFunction · 0.85
TestHeap_AddFunction · 0.85
TestHeap_BulkAddFunction · 0.85
TestHeapEmptyPopFunction · 0.85
TestHeap_AddIfNotPresentFunction · 0.85
TestHeap_DeleteFunction · 0.85
TestHeap_UpdateFunction · 0.85
TestHeap_GetFunction · 0.85
TestHeap_GetByKeyFunction · 0.85
TestHeap_CloseFunction · 0.85
TestHeap_ListFunction · 0.85
TestHeap_ListKeysFunction · 0.85

Calls

no outgoing calls

Tested by 13

TestHeapBasicFunction · 0.68
TestHeap_AddFunction · 0.68
TestHeap_BulkAddFunction · 0.68
TestHeapEmptyPopFunction · 0.68
TestHeap_AddIfNotPresentFunction · 0.68
TestHeap_DeleteFunction · 0.68
TestHeap_UpdateFunction · 0.68
TestHeap_GetFunction · 0.68
TestHeap_GetByKeyFunction · 0.68
TestHeap_CloseFunction · 0.68
TestHeap_ListFunction · 0.68
TestHeap_ListKeysFunction · 0.68