loadbalance

package
v0.10.11 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "proglog"

Variables

This section is empty.

Functions

This section is empty.

Types

type Picker

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

Picker represents an entity for picking which connection to use for a request. It is the load balancing component of the gRPC request resolution process.

func (*Picker) Build

func (p *Picker) Build(buildInfo base.PickerBuildInfo) balancer.Picker

Seperates the connections to the followers from the connection to the leader and stores them in a Picker instance. The picker instance built is returned.

func (*Picker) Pick

func (p *Picker) Pick(info balancer.PickInfo) (balancer.PickResult, error)

Picks the subconnection to use for the given request. All writes(i.e. Produce) go through the leader. Read(i.e Consume) requests are balanced among followers in a round robin fashion.

Returns the subconnection picked, along with an error if any.

type Resolver

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

func (*Resolver) Build

Sets up a client connection for querying details of servers in the cluster.

func (*Resolver) Close

func (r *Resolver) Close()

Closes the resolver connection.

func (*Resolver) ResolveNow

func (r *Resolver) ResolveNow(resolver.ResolveNowOptions)

Fetches the list of servers with a GetServersRequest api call, and obtains the resolved addresses to use.

func (*Resolver) Scheme

func (r *Resolver) Scheme() string

Name to use for our scheme for gRPC to filter out and resolve to our resolver. Our target server addresses will be formatted like "proglog://our-service-address"

Jump to

Keyboard shortcuts

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