registry

package
v0.0.0-...-674c101 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnknownTarget is the error returned when the target address of the node
	// is unknown.
	ErrUnknownTarget = errors.New("target address unknown")
)

Functions

This section is empty.

Types

type IResolver

type IResolver interface {
	Resolve(uint64, uint64) (string, string, error)
	Add(uint64, uint64, string)
}

IResolver converts the (shard id, replica id) tuple to network address.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry is used to manage all known node addresses in the multi raft system. The transport layer uses this address registry to locate nodes.

func NewNodeRegistry

func NewNodeRegistry(v config.TargetValidator) *Registry

NewNodeRegistry returns a new Registry object.

func (*Registry) Add

func (n *Registry) Add(shardID uint64, replicaID uint64, target string)

Add adds the specified replica and its target info to the registry.

func (*Registry) Close

func (n *Registry) Close() error

Close closes the registry.

func (*Registry) Remove

func (n *Registry) Remove(shardID uint64, replicaID uint64)

Remove removes a remote from the node registry.

func (*Registry) RemoveShard

func (n *Registry) RemoveShard(shardID uint64)

RemoveShard removes info associated with the specified shard.

func (*Registry) Resolve

func (n *Registry) Resolve(shardID uint64, replicaID uint64) (string, string, error)

Resolve looks up the address of the specified node.

Jump to

Keyboard shortcuts

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