Documentation ¶
Index ¶
- func NewConnCheckRouter(url *common.URL, notify chan struct{}) (router.PriorityRouter, error)
- func NewDefaultConnChecker(url *common.URL) router.ConnChecker
- type ConnCheckRouteFactory
- type ConnCheckRouter
- func (r *ConnCheckRouter) ConnChecker() router.ConnChecker
- func (r *ConnCheckRouter) Name() string
- func (r *ConnCheckRouter) Pool(invokers []protocol.Invoker) (router.AddrPool, router.AddrMetadata)
- func (r *ConnCheckRouter) Priority() int64
- func (r *ConnCheckRouter) Route(invokers *roaring.Bitmap, cache router.Cache, url *common.URL, ...) *roaring.Bitmap
- func (r *ConnCheckRouter) RouteSnapshot(cache router.Cache) string
- func (r *ConnCheckRouter) ShouldPool() bool
- func (r *ConnCheckRouter) URL() *common.URL
- type DefaultConnChecker
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 ¶
func (r *ConnCheckRouter) Pool(invokers []protocol.Invoker) (router.AddrPool, router.AddrMetadata)
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.
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