Documentation
¶
Index ¶
- Constants
- func GetHash(value []byte, base uint) int
- type BackendList
- type BackendListSorter
- type BackendRR
- type BalanceRR
- func (brr *BalanceRR) Balance(algor int, key []byte) (*backend.BfeBackend, error)
- func (brr *BalanceRR) Init(conf cluster_table_conf.SubClusterBackend)
- func (brr *BalanceRR) Len() int
- func (brr *BalanceRR) Release()
- func (brr *BalanceRR) SetSlowStart(ssTime int)
- func (brr *BalanceRR) Update(conf cluster_table_conf.SubClusterBackend)
- type WeightSS
Constants ¶
View Source
const ( WrrSimple = 0 WrrSmooth = 1 WrrSticky = 2 WlcSimple = 3 WlcSmooth = 4 )
implementation versions of weighted round-robin algorithm
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BackendList ¶
type BackendList []*BackendRR
func (*BackendList) ResetWeight ¶
func (bl *BackendList) ResetWeight()
type BackendListSorter ¶
type BackendListSorter struct {
// contains filtered or unexported fields
}
func (BackendListSorter) Len ¶
func (s BackendListSorter) Len() int
func (BackendListSorter) Less ¶
func (s BackendListSorter) Less(i, j int) bool
func (BackendListSorter) Swap ¶
func (s BackendListSorter) Swap(i, j int)
type BackendRR ¶
type BackendRR struct {
// contains filtered or unexported fields
}
func NewBackendRR ¶
func NewBackendRR() *BackendRR
func (*BackendRR) Init ¶
func (backRR *BackendRR) Init(subClusterName string, conf *cluster_table_conf.BackendConf)
Init initialize BackendRR with BackendConf
func (*BackendRR) MatchAddrPort ¶
func (*BackendRR) UpdateWeight ¶
type BalanceRR ¶
func NewBalanceRR ¶
func (*BalanceRR) Init ¶
func (brr *BalanceRR) Init(conf cluster_table_conf.SubClusterBackend)
Init initializes RRList with config.
func (*BalanceRR) SetSlowStart ¶ added in v1.1.0
func (*BalanceRR) Update ¶
func (brr *BalanceRR) Update(conf cluster_table_conf.SubClusterBackend)
Update updates BalanceRR with new config.
Click to show internal directories.
Click to hide internal directories.