discovery

package
v0.0.0-...-db32783 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiscoveryService

func NewDiscoveryService(dkvService serverpb.DKVServer, logger *zap.Logger, config *opts.DiscoveryServerConfig) (serverpb.DKVDiscoveryServer, error)

Types

type Client

type Client interface {
	StatusPropagator
	ClusterInfoGetter
}

func NewDiscoveryClient

func NewDiscoveryClient(config *opts.DiscoveryClientConfig, logger *zap.Logger) (Client, error)

type ClusterInfoGetter

type ClusterInfoGetter interface {
	// GetClusterStatus get the status of nodes matching given database and vBucket
	GetClusterStatus(database string, vBucket string) ([]*serverpb.RegionInfo, error)
}

ClusterInfoGetter is the interface to get status updates of cluster based on request criteria

type StatusPropagator

type StatusPropagator interface {
	// propagate status updates of all regions in the node to the discovery system
	PropagateStatus()
	// register regions part of current node
	RegisterRegion(server serverpb.DKVDiscoveryNodeServer)
	// Sends one last status update before closing
	// This should ideally be called after closing all regions so that status update is correct
	Close() error
}

StatusPropagator is the interface to propagate status updates of all regions in the node to the discovery system

Jump to

Keyboard shortcuts

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