selector

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 2 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

Overview

Package selector defines the PodSelector contract for PD-disaggregated routing. A PodSelector takes the full list of ready pods and returns the chosen prefill pod (may be nil for combined-role routing) and decode pod for a given request.

The DefaultSelector returned by NewDefaultSelector wraps a scoring function supplied by the router; future phases will move the scoring logic here so it can be composed and tested independently of the router.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultSelector

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

DefaultSelector wraps a SelectFunc as a PodSelector. This lets the router register its existing filterPrefillDecodePods method behind the interface without moving the implementation prematurely.

func (*DefaultSelector) Select

func (s *DefaultSelector) Select(routingCtx *types.RoutingContext, readyPods []*v1.Pod) (*v1.Pod, *v1.Pod, error)

type PodSelector

type PodSelector interface {
	Select(routingCtx *types.RoutingContext, readyPods []*v1.Pod) (prefill *v1.Pod, decode *v1.Pod, err error)
}

PodSelector picks a prefill/decode pod pair from the full ready-pod list. A nil prefill pod signals combined-role routing (decode pod handles both phases).

A successful Select also registers the chosen pods with the request trackers it consulted, atomically with the decision, so that concurrent selections observe each other; the caller (Route) owns the matching removals.

func NewDefaultSelector

func NewDefaultSelector(fn SelectFunc) PodSelector

NewDefaultSelector returns a PodSelector backed by fn.

type SelectFunc

type SelectFunc func(routingCtx *types.RoutingContext, readyPods []*v1.Pod) (*v1.Pod, *v1.Pod, error)

SelectFunc is a function signature matching PodSelector.Select.

Jump to

Keyboard shortcuts

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