Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterScheduler(dynconfig config.Dynconfig)
- func RegisterSeedPeer(dynconfig config.DynconfigInterface)
- type SchedulerResolver
- func (r *SchedulerResolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
- func (r *SchedulerResolver) Close()
- func (r *SchedulerResolver) OnNotify(data *config.DynconfigData)
- func (r *SchedulerResolver) ResolveNow(resolver.ResolveNowOptions)
- func (r *SchedulerResolver) Scheme() string
- type SeedPeerResolver
- func (r *SeedPeerResolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
- func (r *SeedPeerResolver) Close()
- func (r *SeedPeerResolver) OnNotify(data *config.DynconfigData)
- func (r *SeedPeerResolver) ResolveNow(resolver.ResolveNowOptions)
- func (r *SeedPeerResolver) Scheme() string
Constants ¶
const (
// SchedulerScheme is the scheduler schema used by resolver.
SchedulerScheme = "sched"
)
const (
// SeedPeerScheme is the seed peer schema used by resolver.
SeedPeerScheme = "sp"
)
Variables ¶
var ( // SchedulerVirtualTarget is scheduler virtual target. SchedulerVirtualTarget = SchedulerScheme + "://localhost" )
var ( // SeedPeerVirtualTarget is seed peer virtual target. SeedPeerVirtualTarget = fmt.Sprintf("%s://localhost", SeedPeerScheme) )
Functions ¶
func RegisterScheduler ¶
SchedulerRegister register the dragonfly resovler builder to the grpc with custom schema.
func RegisterSeedPeer ¶
func RegisterSeedPeer(dynconfig config.DynconfigInterface)
RegisterSeedPeer register the dragonfly resovler builder to the grpc with custom schema.
Types ¶
type SchedulerResolver ¶
type SchedulerResolver struct {
// contains filtered or unexported fields
}
SchedulerResolver implement resolver.Builder
func (*SchedulerResolver) Build ¶
func (r *SchedulerResolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
Build creates a new resolver for the given target.
gRPC dial calls Build synchronously, and fails if the returned error is not nil.
func (*SchedulerResolver) OnNotify ¶
func (r *SchedulerResolver) OnNotify(data *config.DynconfigData)
OnNotify is triggered and resolver address is updated.
func (*SchedulerResolver) ResolveNow ¶
func (r *SchedulerResolver) ResolveNow(resolver.ResolveNowOptions)
ResolveNow will be called by gRPC to try to resolve the target name again. gRPC will trigger resolveNow everytime SubConn connect fail. But we only need to refresh addresses from manager when all SubConn fail. So here we don't trigger resolving to reduce the pressure of manager.
func (*SchedulerResolver) Scheme ¶
func (r *SchedulerResolver) Scheme() string
Scheme returns the resolver scheme.
type SeedPeerResolver ¶
type SeedPeerResolver struct {
// contains filtered or unexported fields
}
SeedPeerResolver implement resolver.Builder.
func (*SeedPeerResolver) Build ¶
func (r *SeedPeerResolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
Build creates a new resolver for the given target.
gRPC dial calls Build synchronously, and fails if the returned error is not nil.
func (*SeedPeerResolver) OnNotify ¶
func (r *SeedPeerResolver) OnNotify(data *config.DynconfigData)
OnNotify is triggered and resolver address is updated.
func (*SeedPeerResolver) ResolveNow ¶
func (r *SeedPeerResolver) ResolveNow(resolver.ResolveNowOptions)
ResolveNow will be called by gRPC to try to resolve the target name again. gRPC will trigger resolveNow everytime SubConn connect fail. But we only need to refresh addresses from manager when all SubConn fail. So here we don't trigger resolving to reduce the pressure of manager.
func (*SeedPeerResolver) Scheme ¶
func (r *SeedPeerResolver) Scheme() string
Scheme returns the resolver scheme.