delegator

package
v0.34.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsistentReadSupported

func ConsistentReadSupported() bool

ConsistentReadSupported returns whether cache can be used to serve reads with RV not yet observed by cache, including both consistent reads. Function is located here to avoid import cycles between staging/src/k8s.io/apiserver/pkg/storage/cacher/delegator.go and staging/src/k8s.io/apiserver/pkg/util/flow_control/request/list_work_estimator.go.

Types

type CacheWithoutSnapshots

type CacheWithoutSnapshots struct{}

func (CacheWithoutSnapshots) ShouldDelegateConsistentRead

func (c CacheWithoutSnapshots) ShouldDelegateConsistentRead() (Result, error)

func (CacheWithoutSnapshots) ShouldDelegateContinue

func (c CacheWithoutSnapshots) ShouldDelegateContinue(continueToken string, recursive bool) (Result, error)

func (CacheWithoutSnapshots) ShouldDelegateExactRV

func (c CacheWithoutSnapshots) ShouldDelegateExactRV(rv string, recursive bool) (Result, error)

type Helper

type Helper interface {
	ShouldDelegateExactRV(rv string, recursive bool) (Result, error)
	ShouldDelegateContinue(continueToken string, recursive bool) (Result, error)
	ShouldDelegateConsistentRead() (Result, error)
}

type Result

type Result struct {
	// Whether a request cannot be served by cache and should be delegated to etcd.
	ShouldDelegate bool
	// Whether a request is a consistent read, used by delegator to decide if it should call GetCurrentResourceVersion to get RV.
	// Included in interface as only cacher has keyPrefix needed to parse continue token.
	ConsistentRead bool
}

Result of delegator decision.

func ShouldDelegateList

func ShouldDelegateList(opts storage.ListOptions, cache Helper) (Result, error)

func ShouldDelegateListMeta

func ShouldDelegateListMeta(opts *metav1.ListOptions, cache Helper) (Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳