bfe_balance

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalMap

type BalMap map[string]*bal_gslb.BalanceGslb

BalMap holds mappings from clusterName to BalanceGslb.

type BalTable

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

func NewBalTable

func NewBalTable(checkConfFetcher backend.CheckConfFetcher) *BalTable

func (*BalTable) BalTableConfLoad

func (t *BalTable) BalTableConfLoad(gslbConfFilename, clusterTableFilename string) (
	gslb_conf.GslbConf, cluster_table_conf.ClusterTableConf, error)

func (*BalTable) BalTableReload

func (t *BalTable) BalTableReload(gslbConfs gslb_conf.GslbConf,
	backendConfs cluster_table_conf.ClusterTableConf) error

func (*BalTable) GetState

func (t *BalTable) GetState() *BalTableState

GetState returns state of BalTable.

func (*BalTable) GetVersions

func (t *BalTable) GetVersions() BalVersion

GetVersions returns versions of BalTable.

func (*BalTable) Init

func (t *BalTable) Init(gslbConfFilename, clusterTableFilename string) error

func (*BalTable) Lookup

func (t *BalTable) Lookup(clusterName string) (*bal_gslb.BalanceGslb, error)

Lookup lookup BalanceGslb by cluster name.

func (*BalTable) SetGslbBasic

func (t *BalTable) SetGslbBasic(clusterTable *bfe_route.ClusterTable)

SetGslbBasic sets gslb basic conf (from server data conf) for BalTable.

Note:

  • SetGslbBasic() is called after server reload gslb conf or server data conf
  • SetGslbBasic() should be concurrency safe

func (*BalTable) SetSlowStart added in v1.1.0

func (t *BalTable) SetSlowStart(clusterTable *bfe_route.ClusterTable)

SetSlowStart sets slow_start related conf (from server data conf) for BalTable.

Note:

  • SetSlowStart() is called after server reload server data conf
  • SetSlowStart() should be concurrency safe

type BalTableState

type BalTableState struct {
	Balancers  map[string]*bal_gslb.GslbState // state of cluster
	BackendNum int                            // size of backendTable
}

func NewBalTableState

func NewBalTableState() *BalTableState

type BalVersion

type BalVersion struct {
	ClusterTableConfVer string // cluster table conf version
	GslbConfTimeStamp   string // timestamp of gslb-conf
	GslbConfSrc         string // which gslb-scheduler come from?
}

type BfeBalance

type BfeBalance interface {
	// Init initialize
	Init(backendConf cluster_table_conf.ClusterBackend,
		gslbBasic cluster_conf.GslbBasicConf,
		gslbConf gslb_conf.GslbClusterConf) error
	// Reload reload config
	Reload(backendConf cluster_table_conf.ClusterBackend,
		gslbBasic cluster_conf.GslbBasicConf,
		gslbConf gslb_conf.GslbClusterConf) error
	// Balance load balance for request
	Balance(req *bfe_basic.Request) (*backend.BfeBackend, error)
	// Release releases
	Release()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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