discoverer

package
v0.0.0-...-34e0b2d Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discoverer

type Discoverer interface {
	// NewVersionedState returns a lowest versioned state.
	NewVersionedState() VersionedState

	// Discover watches the service discovery on these goroutine.
	// 1. Call the callback when the discovery is changed, and block until the discovery is canceled or break down.
	// 2. Discover should always send the current state first and then block.
	Discover(ctx context.Context, cb func(VersionedState) error) error
}

Discoverer is the interface for the discoverer. Do not promise 1. concurrent safe. 2. the version of discovery may be repeated or decreasing. So user should check the version in callback.

func NewChannelAssignmentDiscoverer

func NewChannelAssignmentDiscoverer(logCoordManager types.AssignmentDiscoverWatcher) Discoverer

NewChannelAssignmentDiscoverer returns a new Discoverer for the channel assignment registration.

func NewSessionDiscoverer

func NewSessionDiscoverer(etcdCli *clientv3.Client, prefix string, minimumVersion string) Discoverer

NewSessionDiscoverer returns a new Discoverer for the milvus session registration.

type VersionedState

type VersionedState struct {
	Version typeutil.Version
	State   resolver.State
}

VersionedState is the state with version.

func (*VersionedState) ChannelAssignmentInfo

func (s *VersionedState) ChannelAssignmentInfo() map[int64]types.StreamingNodeAssignment

ChannelAssignmentInfo returns the channel assignment info from the resolver state.

func (*VersionedState) Sessions

func (s *VersionedState) Sessions() map[int64]*sessionutil.SessionRaw

Sessions returns the sessions in the state. Should only be called when using session discoverer.

Jump to

Keyboard shortcuts

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