conncheck

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnCheckRouter

func NewConnCheckRouter(url *common.URL, notify chan struct{}) (router.PriorityRouter, error)

NewConnCheckRouter construct an NewConnCheckRouter via url

func NewDefaultConnChecker

func NewDefaultConnChecker(url *common.URL) router.ConnChecker

NewDefaultConnChecker constructs a new DefaultConnChecker based on the url

Types

type ConnCheckRouteFactory

type ConnCheckRouteFactory struct {
}

ConnCheckRouteFactory is the factory to create conn check router, it aims at filter ip with unhealthy status the unhealthy status is storied in protocol/rpc_status.go with sync.Map

func (*ConnCheckRouteFactory) NewPriorityRouter

func (f *ConnCheckRouteFactory) NewPriorityRouter(url *common.URL, notify chan struct{}) (router.PriorityRouter, error)

NewPriorityRouter construct a new NewConnCheckRouter via url

type ConnCheckRouter

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

ConnCheckRouter provides a health-first routing mechanism through ConnChecker

func (*ConnCheckRouter) ConnChecker

func (r *ConnCheckRouter) ConnChecker() router.ConnChecker

ConnChecker returns the HealthChecker bound to this HealthCheckRouter

func (*ConnCheckRouter) Name

func (r *ConnCheckRouter) Name() string

Name get name of ConnCheckerRouter

func (*ConnCheckRouter) Pool

Pool separates healthy invokers from others.

func (*ConnCheckRouter) Priority

func (r *ConnCheckRouter) Priority() int64

Priority get Router priority level

func (*ConnCheckRouter) Route

func (r *ConnCheckRouter) Route(invokers *roaring.Bitmap, cache router.Cache, url *common.URL, invocation protocol.Invocation) *roaring.Bitmap

Route gets a list of healthy invoker

func (*ConnCheckRouter) RouteSnapshot added in v1.5.7

func (r *ConnCheckRouter) RouteSnapshot(cache router.Cache) string

func (*ConnCheckRouter) ShouldPool

func (r *ConnCheckRouter) ShouldPool() bool

ShouldPool will always return true to make sure healthy check constantly.

func (*ConnCheckRouter) URL

func (r *ConnCheckRouter) URL() *common.URL

URL Return URL in router

type DefaultConnChecker

type DefaultConnChecker struct {
}

DefaultConnChecker is the default implementation of ConnChecker, which determines the health status of invoker conn

func (*DefaultConnChecker) IsConnHealthy

func (c *DefaultConnChecker) IsConnHealthy(invoker protocol.Invoker) bool

IsConnHealthy evaluates the healthy state on the given Invoker based on the number of successive bad request and the current active request

Jump to

Keyboard shortcuts

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