resolver

package
v2.1.64 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SchedulerScheme is the scheduler schema used by resolver.
	SchedulerScheme = "sched"
)
View Source
const (
	// SeedPeerScheme is the seed peer schema used by resolver.
	SeedPeerScheme = "sp"
)

Variables

View Source
var (
	// SchedulerVirtualTarget is scheduler virtual target.
	SchedulerVirtualTarget = SchedulerScheme + "://localhost"
)
View Source
var (
	// SeedPeerVirtualTarget is seed peer virtual target.
	SeedPeerVirtualTarget = fmt.Sprintf("%s://localhost", SeedPeerScheme)
)

Functions

func RegisterScheduler

func RegisterScheduler(dynconfig config.Dynconfig)

RegisterScheduler registers the dragonfly resolver 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

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) Close

func (r *SchedulerResolver) Close()

Close closes the resolver.

func (*SchedulerResolver) OnNotify

func (r *SchedulerResolver) OnNotify(data *config.DynconfigData)

OnNotify is triggered and resolver address is updated.

func (*SchedulerResolver) ResolveNow

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

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) Close

func (r *SeedPeerResolver) Close()

Close closes the resolver.

func (*SeedPeerResolver) OnNotify

func (r *SeedPeerResolver) OnNotify(data *config.DynconfigData)

OnNotify is triggered and resolver address is updated.

func (*SeedPeerResolver) ResolveNow

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.

Jump to

Keyboard shortcuts

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