clusterpeers

package
v0.0.0-...-daaf58e Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

func ConstructCluster

func ConstructCluster(roleId uint64, disk *recovery.Manager) (*Cluster, uint64, string, error)

func (*Cluster) BroadcastHeartbeat

func (this *Cluster) BroadcastHeartbeat(roleId uint64)

Sends pulse to all nodes in the cluster

func (*Cluster) BroadcastPrepareRequest

func (this *Cluster) BroadcastPrepareRequest(request acceptor.PrepareReq) (uint64, <-chan Response)

Broadcasts a prepare phase request to the cluster

func (*Cluster) BroadcastProposalRequest

func (this *Cluster) BroadcastProposalRequest(request acceptor.ProposalReq, filter map[uint64]bool) (uint64, <-chan Response)

Broadcasts a proposal phase request to the cluster

func (*Cluster) Connect

func (this *Cluster) Connect()

Initializes connections to cluster peers

func (*Cluster) GetPeerCount

func (this *Cluster) GetPeerCount() uint64

Returns number of peers in cluster

func (*Cluster) GetSkipPromiseCount

func (this *Cluster) GetSkipPromiseCount() uint64

Returns number of peers from which no promise is required

func (*Cluster) Listen

func (this *Cluster) Listen(handler *rpc.Server) error

Sets server to listen on this node's port

func (*Cluster) NotifyOfSuccess

func (this *Cluster) NotifyOfSuccess(roleId uint64, info acceptor.SuccessNotify) <-chan Response

Directly notifies a specific node of a chosen value

func (*Cluster) SetPromiseRequirement

func (this *Cluster) SetPromiseRequirement(roleId uint64, required bool)

Mark whether a promise is required from a node before sending accept requests

type Peer

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

type Response

type Response struct {
	Data interface{}
}

Jump to

Keyboard shortcuts

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