Documentation ¶
Index ¶
- func NewDefaultHealthChecker(url *common.URL) router.HealthChecker
- func NewHealthCheckRouter(url *common.URL, notify chan struct{}) (router.PriorityRouter, error)
- type DefaultHealthChecker
- type HealthCheckRouteFactory
- type HealthCheckRouter
- func (r *HealthCheckRouter) HealthyChecker() router.HealthChecker
- func (r *HealthCheckRouter) Name() string
- func (r *HealthCheckRouter) Pool(invokers []protocol.Invoker) (router.AddrPool, router.AddrMetadata)
- func (r *HealthCheckRouter) Priority() int64
- func (r *HealthCheckRouter) Route(invokers *roaring.Bitmap, cache router.Cache, url *common.URL, ...) *roaring.Bitmap
- func (r *HealthCheckRouter) ShouldPool() bool
- func (r *HealthCheckRouter) URL() *common.URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultHealthChecker ¶
func NewDefaultHealthChecker(url *common.URL) router.HealthChecker
NewDefaultHealthChecker constructs a new DefaultHealthChecker based on the url
func NewHealthCheckRouter ¶
func NewHealthCheckRouter(url *common.URL, notify chan struct{}) (router.PriorityRouter, error)
NewHealthCheckRouter construct an HealthCheckRouter via url
Types ¶
type DefaultHealthChecker ¶
type DefaultHealthChecker struct {
// contains filtered or unexported fields
}
DefaultHealthChecker is the default implementation of HealthChecker, which determines the health status of the invoker based on the number of successive bad request and the current active request.
func (*DefaultHealthChecker) GetCircuitTrippedTimeoutFactor ¶
func (c *DefaultHealthChecker) GetCircuitTrippedTimeoutFactor() int32
GetCircuitTrippedTimeoutFactor return the circuitTrippedTimeoutFactor bound to this DefaultHealthChecker
func (*DefaultHealthChecker) GetOutStandingRequestCountLimit ¶ added in v1.5.1
func (c *DefaultHealthChecker) GetOutStandingRequestCountLimit() int32
GetOutStandingRequestCountLimit return the outStandingRequestConutLimit bound to this DefaultHealthChecker
func (*DefaultHealthChecker) GetRequestSuccessiveFailureThreshold ¶
func (c *DefaultHealthChecker) GetRequestSuccessiveFailureThreshold() int32
GetRequestSuccessiveFailureThreshold return the requestSuccessiveFailureThreshold bound to this DefaultHealthChecker
type HealthCheckRouteFactory ¶
type HealthCheckRouteFactory struct { }
HealthCheckRouteFactory
func (*HealthCheckRouteFactory) NewPriorityRouter ¶ added in v1.5.0
func (f *HealthCheckRouteFactory) NewPriorityRouter(url *common.URL, notify chan struct{}) (router.PriorityRouter, error)
NewPriorityRouter construct a new NewHealthCheckRouter via url
type HealthCheckRouter ¶
type HealthCheckRouter struct {
// contains filtered or unexported fields
}
HealthCheckRouter provides a health-first routing mechanism through HealthChecker
func (*HealthCheckRouter) HealthyChecker ¶
func (r *HealthCheckRouter) HealthyChecker() router.HealthChecker
HealthyChecker returns the HealthChecker bound to this HealthCheckRouter
func (*HealthCheckRouter) Name ¶ added in v1.5.5
func (r *HealthCheckRouter) Name() string
func (*HealthCheckRouter) Pool ¶ added in v1.5.5
func (r *HealthCheckRouter) Pool(invokers []protocol.Invoker) (router.AddrPool, router.AddrMetadata)
Pool separates healthy invokers from others.
func (*HealthCheckRouter) Route ¶
func (r *HealthCheckRouter) Route(invokers *roaring.Bitmap, cache router.Cache, url *common.URL, invocation protocol.Invocation) *roaring.Bitmap
Route gets a list of healthy invoker
func (*HealthCheckRouter) ShouldPool ¶ added in v1.5.5
func (r *HealthCheckRouter) ShouldPool() bool
ShouldPool will always return true to make sure healthy check constantly.
func (*HealthCheckRouter) URL ¶
func (r *HealthCheckRouter) URL() *common.URL
URL Return URL in router