selector

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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).

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