loadbalance

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: Apache-2.0 Imports: 17 Imported by: 163

Documentation

Index

Constants

View Source
const (
	// ConsistentHash ...
	ConsistentHash = "consistenthash"
	// HashNodes ...
	HashNodes = "hash.nodes"
	// HashArguments ...
	HashArguments = "hash.arguments"
)
View Source
const (
	// RoundRobin ...
	RoundRobin = "roundrobin"

	// COMPLETE ...
	COMPLETE = 0
	// UPDATING ...
	UPDATING = 1
)
View Source
const (
	// LeastActive ...
	LeastActive = "leastactive"
)

Variables

This section is empty.

Functions

func GetWeight

func GetWeight(invoker protocol.Invoker, invocation protocol.Invocation) int64

GetWeight ...

func NewConsistentHashLoadBalance added in v1.3.0

func NewConsistentHashLoadBalance() cluster.LoadBalance

NewConsistentHashLoadBalance ...

func NewLeastActiveLoadBalance

func NewLeastActiveLoadBalance() cluster.LoadBalance

NewLeastActiveLoadBalance ...

func NewRandomLoadBalance

func NewRandomLoadBalance() cluster.LoadBalance

NewRandomLoadBalance ...

func NewRoundRobinLoadBalance

func NewRoundRobinLoadBalance() cluster.LoadBalance

NewRoundRobinLoadBalance ...

Types

type ConsistentHashLoadBalance added in v1.3.0

type ConsistentHashLoadBalance struct {
}

ConsistentHashLoadBalance ...

func (*ConsistentHashLoadBalance) Select added in v1.3.0

func (lb *ConsistentHashLoadBalance) Select(invokers []protocol.Invoker, invocation protocol.Invocation) protocol.Invoker

Select ...

type ConsistentHashSelector added in v1.3.0

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

ConsistentHashSelector ...

func (*ConsistentHashSelector) Select added in v1.3.0

Select ...

type Uint32Slice added in v1.3.0

type Uint32Slice []uint32

Uint32Slice ...

func (Uint32Slice) Len added in v1.3.0

func (s Uint32Slice) Len() int

func (Uint32Slice) Less added in v1.3.0

func (s Uint32Slice) Less(i, j int) bool

func (Uint32Slice) Swap added in v1.3.0

func (s Uint32Slice) Swap(i, j int)

Jump to

Keyboard shortcuts

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