loadstore

package
v1.57.0-dev Latest Latest
Warning

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

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

Documentation

Overview

Package loadstore contains the loadStoreWrapper shared by the balancers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wrapper

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

Wrapper wraps a load store with cluster and edsService.

It's store and cluster/edsService can be updated separately. And it will update its internal perCluster store so that new stats will be added to the correct perCluster.

Note that this struct is a temporary walkaround before we implement graceful switch for EDS. Any update to the clusterName and serviceName is too early, the perfect timing is when the picker is updated with the new connection. This early update could cause picks for the old SubConn being reported to the new services.

When the graceful switch in EDS is done, there should be no need for this struct. The policies that record/report load shouldn't need to handle update of lrsServerName/cluster/edsService. Its parent should do a graceful switch of the whole tree when one of that changes.

func NewWrapper

func NewWrapper() *Wrapper

NewWrapper creates a Wrapper.

func (*Wrapper) CallDropped

func (lsw *Wrapper) CallDropped(category string)

CallDropped records a call dropped in the store.

func (*Wrapper) CallFinished

func (lsw *Wrapper) CallFinished(locality string, err error)

CallFinished records a call finished in the store.

func (*Wrapper) CallServerLoad

func (lsw *Wrapper) CallServerLoad(locality, name string, val float64)

CallServerLoad records the server load in the store.

func (*Wrapper) CallStarted

func (lsw *Wrapper) CallStarted(locality string)

CallStarted records a call started in the store.

func (*Wrapper) UpdateClusterAndService

func (lsw *Wrapper) UpdateClusterAndService(cluster, edsService string)

UpdateClusterAndService updates the cluster name and eds service for this wrapper. If any one of them is changed from before, the perCluster store in this wrapper will also be updated.

func (*Wrapper) UpdateLoadStore

func (lsw *Wrapper) UpdateLoadStore(store *load.Store)

UpdateLoadStore updates the load store for this wrapper. If it is changed from before, the perCluster store in this wrapper will also be updated.

Jump to

Keyboard shortcuts

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