Documentation
¶
Index ¶
- type Block
- type LPRadixCache
- func (c *LPRadixCache) AddPrefix(tokens []int, model string, podName string) (*TreeNode, []int, []int)
- func (c *LPRadixCache) Evict(now time.Time) []*TreeNode
- func (c *LPRadixCache) GetAllNodes() map[int]*TreeNode
- func (c *LPRadixCache) GetAllPodsInNode(node *TreeNode) []string
- func (c *LPRadixCache) GetNode(tokens []int) *TreeNode
- func (c *LPRadixCache) MatchPrefix(inputTokens []int, model string, pods []*v1.Pod) ([]int, []int, []*v1.Pod)
- func (c *LPRadixCache) NewTreeNode(numPods int, parent *TreeNode, key []int, value []int) *TreeNode
- func (c *LPRadixCache) PrettyPrint()
- type PrefixHashTable
- type TreeNode
- func (n *TreeNode) AddOrUpdatePodForModel(model string, podName string, timestamp time.Time)
- func (n *TreeNode) ContextLength() int
- func (n *TreeNode) GetCachedPods() map[int]bool
- func (n *TreeNode) GetChildren() map[int]*TreeNode
- func (n *TreeNode) GetDepth() int
- func (n *TreeNode) GetEvictedPods() map[int]bool
- func (n *TreeNode) GetID() int
- func (n *TreeNode) GetKey() []int
- func (n *TreeNode) GetLastAccess() time.Time
- func (n *TreeNode) GetLoad() int
- func (n *TreeNode) GetModelToPodCount() int
- func (n *TreeNode) GetModelToPods() map[string]map[string]time.Time
- func (n *TreeNode) GetParent() *TreeNode
- func (n *TreeNode) GetPodsForModel(model string) map[string]time.Time
- func (n *TreeNode) GetRefCounter() []int
- func (n *TreeNode) GetValue() []int
- func (n *TreeNode) HasPodForModel(model, podName string) bool
- func (n *TreeNode) HasValidPods(currentPodSet map[string]bool) bool
- func (n *TreeNode) InitAndUpdateModelPod(model string, podName string, timestamp time.Time)
- func (n *TreeNode) NumTokens() int
- func (n *TreeNode) RemovePodsNotInCurrentPodSet(currentPodSet map[string]bool) bool
- func (n *TreeNode) RemovePodsNotInSet(currentPodSet map[string]bool) bool
- func (n *TreeNode) ResetCachedPods()
- func (n *TreeNode) ResetEvictedPods()
- func (n *TreeNode) ResetRefCounter(numPods int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LPRadixCache ¶
type LPRadixCache struct {
// contains filtered or unexported fields
}
func NewLPRadixCache ¶
func NewLPRadixCache(numPods int) *LPRadixCache
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 (*LPRadixCache) NewTreeNode ¶
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 (*TreeNode) ContextLength ¶
func (*TreeNode) GetCachedPods ¶
func (*TreeNode) GetChildren ¶
func (*TreeNode) GetEvictedPods ¶
func (*TreeNode) GetLastAccess ¶
func (*TreeNode) GetModelToPodCount ¶
func (*TreeNode) GetModelToPods ¶
func (*TreeNode) GetPodsForModel ¶
func (*TreeNode) GetRefCounter ¶
func (*TreeNode) HasPodForModel ¶
func (*TreeNode) InitAndUpdateModelPod ¶
func (*TreeNode) RemovePodsNotInCurrentPodSet ¶
func (*TreeNode) RemovePodsNotInSet ¶
func (*TreeNode) ResetCachedPods ¶
func (n *TreeNode) ResetCachedPods()
func (*TreeNode) ResetEvictedPods ¶
func (n *TreeNode) ResetEvictedPods()
func (*TreeNode) ResetRefCounter ¶
Click to show internal directories.
Click to hide internal directories.