server

package
Version: v0.0.0-...-b2a47e0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 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 AntiEntropyRound

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

AntiEntropyRound represents a round of anti-entropy with another vulture host.

func NewAntiEntropyRound

func NewAntiEntropyRound(peer Peer, tree *mst.MerkleSearchTree) AntiEntropyRound

NewAntiEntropyRound creates new AntiEntropyRound

type EndRoundFunc

type EndRoundFunc func()

EndRoundFunc is the signature for ending the anti entropy round When called, it tells the caller that the round is over so that it can clean up whatever needs to be cleaned up

type MSTManagerServer

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

MSTManagerServer stores data required for managing the Vulture server TODO: right now we don't do any cleanup of destination rounds, so there may be a memory leak if we have stray rounds. We could include a garbage collection round at some point here.

func NewMSTManagerServer

func NewMSTManagerServer(
	server *MSTServer,
	kr mst.KeyReader,
	vr mst.ValueReader,
) *MSTManagerServer

NewMSTManagerServer creates a new Vulture management server

func (*MSTManagerServer) RoundStart

RoundStart starts a round of anti entropy

func (*MSTManagerServer) RoundStep

RoundStep does a step of anti entropy

type MSTServer

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

MSTServer stores all local data required for running the Vulture server

func NewMSTServer

func NewMSTServer(tree *mst.MerkleSearchTree, peers *Peers) *MSTServer

NewMSTServer creates a new Vulture server

func (*MSTServer) Get

Get returns the value for a given key

func (*MSTServer) Put

func (s *MSTServer) Put(ctx context.Context, in *rpc.MSTPutRequest) (*empty.Empty, error)

Put inserts the given value for the given key

type Peer

type Peer struct {
	Hostname string
	Port     int
}

type PeerSelectionStrategy

type PeerSelectionStrategy interface {
	Select(peers map[Peer]bool) []Peer
}

type Peers

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

func NewPeers

func NewPeers(selectionStrategy PeerSelectionStrategy) *Peers

func (*Peers) Add

func (ps *Peers) Add(hostname string, port int)

func (*Peers) Select

func (ps *Peers) Select() []Peer

type SelectAll

type SelectAll struct{}

func (*SelectAll) Select

func (s *SelectAll) Select(peerSet map[Peer]bool) []Peer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL