kubernetes/pkg/scheduler/backend/heap/heap.go

type KeyFunc

type heapItem

type itemKeyValue

type data

var _

// Less compares two objects and returns true if the first one should go
// in front of the second one in the heap.
func (h *data[T]) Less(i, j int) bool {}

// Len returns the number of items in the Heap.
func (h *data[T]) Len() int {}

// Swap implements swapping of two elements in the heap. This is a part of standard
// heap interface and should never be called directly.
func (h *data[T]) Swap(i, j int) {}

// Push is supposed to be called by container/heap.Push only.
func (h *data[T]) Push(kv interface{}

// Pop is supposed to be called by container/heap.Pop only.
func (h *data[T]) Pop() interface{}

// Peek returns the head of the heap without removing it.
func (h *data[T]) Peek() (T, bool) {}

type Heap

// AddOrUpdate inserts an item, and puts it in the queue. The item is updated if it
// already exists.
func (h *Heap[T]) AddOrUpdate(obj T) {}

// Delete removes an item.
func (h *Heap[T]) Delete(obj T) error {}

// Peek returns the head of the heap without removing it.
func (h *Heap[T]) Peek() (T, bool) {}

// Pop returns the head of the heap and removes it.
func (h *Heap[T]) Pop() (T, error) {}

// Get returns the requested item, or sets exists=false.
func (h *Heap[T]) Get(obj T) (T, bool) {}

// GetByKey returns the requested item, or sets exists=false.
func (h *Heap[T]) GetByKey(key string) (T, bool) {}

func (h *Heap[T]) Has(obj T) bool {}

// List returns a list of all the items.
func (h *Heap[T]) List() []T {}

// Len returns the number of items in the heap.
func (h *Heap[T]) Len() int {}

// New returns a Heap which can be used to queue up items to process.
func New[T any](keyFn KeyFunc[T], lessFn LessFunc[T]) *Heap[T] {}

// NewWithRecorder wraps an optional metricRecorder to compose a Heap object.
func NewWithRecorder[T any](keyFn KeyFunc[T], lessFn LessFunc[T], metricRecorder metrics.MetricRecorder) *Heap[T] {}

type LessFunc