prefixcacheindexer

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

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

type LPRadixCache

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

func NewLPRadixCache

func NewLPRadixCache(numPods int) *LPRadixCache

func (*LPRadixCache) AddPrefix

func (c *LPRadixCache) AddPrefix(tokens []int, model string, podName string) (*TreeNode, []int, []int)

func (*LPRadixCache) Evict

func (c *LPRadixCache) Evict(now time.Time) []*TreeNode

func (*LPRadixCache) GetAllNodes

func (c *LPRadixCache) GetAllNodes() map[int]*TreeNode

func (*LPRadixCache) GetAllPodsInNode

func (c *LPRadixCache) GetAllPodsInNode(node *TreeNode) []string

func (*LPRadixCache) GetNode

func (c *LPRadixCache) GetNode(tokens []int) *TreeNode

GetNode adds internal method to get node

func (*LPRadixCache) MatchPrefix

func (c *LPRadixCache) MatchPrefix(inputTokens []int, model string, pods []*v1.Pod) ([]int, []int, []*v1.Pod)

func (*LPRadixCache) NewTreeNode

func (c *LPRadixCache) NewTreeNode(numPods int, parent *TreeNode, key []int, value []int) *TreeNode

func (*LPRadixCache) PrettyPrint

func (c *LPRadixCache) PrettyPrint()

type PrefixHashTable

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

func NewPrefixHashTable

func NewPrefixHashTable() *PrefixHashTable

func (*PrefixHashTable) AddPrefix

func (c *PrefixHashTable) AddPrefix(prefixHashes []uint64, model, pod string)

AddPrefix add prefix hashes for input tokens

func (*PrefixHashTable) GetPrefixHashes

func (c *PrefixHashTable) GetPrefixHashes(tokens []byte) []uint64

func (*PrefixHashTable) MatchPrefix

func (c *PrefixHashTable) MatchPrefix(tokens []byte, model string, readyPods map[string]struct{}) (map[string]int, []uint64)

MatchPrefix matches the input token prefix's if already cached returns map[podname]%prefixmatch along with all prefix hashes

type TreeNode

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

func (*TreeNode) AddOrUpdatePodForModel

func (n *TreeNode) AddOrUpdatePodForModel(model string, podName string, timestamp time.Time)

func (*TreeNode) ContextLength

func (n *TreeNode) ContextLength() int

func (*TreeNode) GetCachedPods

func (n *TreeNode) GetCachedPods() map[int]bool

func (*TreeNode) GetChildren

func (n *TreeNode) GetChildren() map[int]*TreeNode

func (*TreeNode) GetDepth

func (n *TreeNode) GetDepth() int

func (*TreeNode) GetEvictedPods

func (n *TreeNode) GetEvictedPods() map[int]bool

func (*TreeNode) GetID

func (n *TreeNode) GetID() int

func (*TreeNode) GetKey

func (n *TreeNode) GetKey() []int

func (*TreeNode) GetLastAccess

func (n *TreeNode) GetLastAccess() time.Time

func (*TreeNode) GetLoad

func (n *TreeNode) GetLoad() int

func (*TreeNode) GetModelToPodCount

func (n *TreeNode) GetModelToPodCount() int

func (*TreeNode) GetModelToPods

func (n *TreeNode) GetModelToPods() map[string]map[string]time.Time

func (*TreeNode) GetParent

func (n *TreeNode) GetParent() *TreeNode

func (*TreeNode) GetPodsForModel

func (n *TreeNode) GetPodsForModel(model string) map[string]time.Time

func (*TreeNode) GetRefCounter

func (n *TreeNode) GetRefCounter() []int

func (*TreeNode) GetValue

func (n *TreeNode) GetValue() []int

func (*TreeNode) HasPodForModel

func (n *TreeNode) HasPodForModel(model, podName string) bool

func (*TreeNode) HasValidPods

func (n *TreeNode) HasValidPods(currentPodSet map[string]bool) bool

func (*TreeNode) InitAndUpdateModelPod

func (n *TreeNode) InitAndUpdateModelPod(model string, podName string, timestamp time.Time)

func (*TreeNode) NumTokens

func (n *TreeNode) NumTokens() int

func (*TreeNode) RemovePodsNotInCurrentPodSet

func (n *TreeNode) RemovePodsNotInCurrentPodSet(currentPodSet map[string]bool) bool

func (*TreeNode) RemovePodsNotInSet

func (n *TreeNode) RemovePodsNotInSet(currentPodSet map[string]bool) bool

func (*TreeNode) ResetCachedPods

func (n *TreeNode) ResetCachedPods()

func (*TreeNode) ResetEvictedPods

func (n *TreeNode) ResetEvictedPods()

func (*TreeNode) ResetRefCounter

func (n *TreeNode) ResetRefCounter(numPods int)

Jump to

Keyboard shortcuts

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