util

package
v0.0.0-...-bc30bd0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterTrueKeys

func FilterTrueKeys(h map[string]bool) []string

func GetListIndex

func GetListIndex(pluginList framework.PluginList) framework.PluginOrder

func LeftChild

func LeftChild(i int) int

func Parent

func Parent(i int) int

func TopHighestScoreNodes

func TopHighestScoreNodes(priorityNodes []api.NodeScore, m int) (resp []api.NodeScore)

TopHighestScoreNodes Get the top m high score nodes

Types

type MinHeap

type MinHeap struct {
	// contains filtered or unexported fields
}

MinHeap implements a min-heap with the smallest of all data stored at the top of the heap. We need to control the lock of this data structure at the upper level.

func NewMinHeap

func NewMinHeap() *MinHeap

NewMinHeap return a pointer to MinHeap. We need to control the lock of this data structure at the upper level.

func (*MinHeap) GetMinVal

func (heap *MinHeap) GetMinVal() (api.NodeScore, error)

func (*MinHeap) GetSize

func (heap *MinHeap) GetSize() int

func (*MinHeap) IsEmpty

func (heap *MinHeap) IsEmpty() bool

func (*MinHeap) Replace

func (heap *MinHeap) Replace(priorityNode api.NodeScore) error

func (*MinHeap) SiftDown

func (heap *MinHeap) SiftDown() (api.NodeScore, error)

func (*MinHeap) SiftUp

func (heap *MinHeap) SiftUp(priorityNode api.NodeScore)

type NodeIndexer

type NodeIndexer struct {
	Name                             string
	NextStartInPartitionNodeIndex    int
	NextStartOutOfPartitionNodeIndex int
}

func NewIndexer

func NewIndexer(name string) *NodeIndexer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL