Documentation ¶
Index ¶
- type CandidateJoinAccumulator
- type ClusterBootstrapService
- type Coordinator
- type CoordinatorPeerFinder
- type FollowersChecker
- type InitialJoinAccumulator
- type JoinAccumulator
- type JoinHelper
- type JoinRequest
- type LeaderChecker
- type Mode
- type Module
- type PeersRequest
- type PeersResponse
- type PreVoteCollector
- type PreVoteRequest
- type PreVoteResponse
- type StartJoinRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CandidateJoinAccumulator ¶
type CandidateJoinAccumulator struct { }
type ClusterBootstrapService ¶
func NewClusterBootstrapService ¶
func NewClusterBootstrapService(service *transport.Service) *ClusterBootstrapService
type Coordinator ¶
type Coordinator struct { TransportService *transport.Service PeerFinder *CoordinatorPeerFinder PersistedState state.PersistedState CoordinationState state.CoordinationState ApplierState *state.ClusterState ClusterApplierService *cluster.ApplierService MasterService *cluster.MasterService ClusterBootstrapService *ClusterBootstrapService PreVoteCollector *PreVoteCollector JoinHelper *JoinHelper Done func() Started bool // contains filtered or unexported fields }
Coordinator
func NewCoordinator ¶
func NewCoordinator(transportService *transport.Service, clusterApplierService *cluster.ApplierService, masterService *cluster.MasterService, persistedState state.PersistedState) *Coordinator
func (*Coordinator) Publish ¶
func (c *Coordinator) Publish(event state.ClusterChangedEvent)
func (*Coordinator) Start ¶
func (c *Coordinator) Start()
func (*Coordinator) StartInitialJoin ¶
func (c *Coordinator) StartInitialJoin()
type CoordinatorPeerFinder ¶
type CoordinatorPeerFinder struct { Coordinator *Coordinator LastAcceptedNodes *state.Nodes //TODO: 얘가 과연 *state.Node여야 할까? PeersByAddress map[string]*state.Node // contains filtered or unexported fields }
func NewCoordinatorPeerFinder ¶
func NewCoordinatorPeerFinder(coordinator *Coordinator) *CoordinatorPeerFinder
type FollowersChecker ¶
type FollowersChecker struct { }
type InitialJoinAccumulator ¶
type InitialJoinAccumulator struct { }
type JoinAccumulator ¶
type JoinAccumulator interface {
// contains filtered or unexported methods
}
type JoinHelper ¶
type JoinHelper struct {
// contains filtered or unexported fields
}
func NewJoinHelper ¶
func NewJoinHelper( transportService *transport.Service, joinLeaderInTerm func(request *StartJoinRequest) *state.Join, currentTermSupplier func() int64, joinHandler func(channel transport.ReplyChannel, req []byte)) *JoinHelper
func (*JoinHelper) SendJoinRequest ¶
func (*JoinHelper) SendStartJoinRequest ¶
func (h *JoinHelper) SendStartJoinRequest(startJoinRequest StartJoinRequest, destination state.Node)
type JoinRequest ¶
func JoinRequestFromBytes ¶
func JoinRequestFromBytes(b []byte) *JoinRequest
func (*JoinRequest) GetTerm ¶
func (r *JoinRequest) GetTerm() int64
func (*JoinRequest) ToBytes ¶
func (r *JoinRequest) ToBytes() []byte
type LeaderChecker ¶
type LeaderChecker struct { }
type PeersRequest ¶
func PeersRequestFromBytes ¶
func PeersRequestFromBytes(b []byte) *PeersRequest
func (*PeersRequest) ToBytes ¶
func (r *PeersRequest) ToBytes() []byte
type PeersResponse ¶
func PeersResponseFromBytes ¶
func PeersResponseFromBytes(b []byte) *PeersResponse
func (*PeersResponse) ToBytes ¶
func (r *PeersResponse) ToBytes() []byte
type PreVoteCollector ¶
func NewPreVoteCollector ¶
func NewPreVoteCollector(transportService *transport.Service, startElection func(), updateMaxTermSeen func(term int64)) *PreVoteCollector
func (*PreVoteCollector) SetVote ¶
func (p *PreVoteCollector) SetVote(key state.Node, value *PreVoteResponse)
func (*PreVoteCollector) Start ¶
func (p *PreVoteCollector) Start()
type PreVoteRequest ¶
func NewPreVoteRequest ¶
func NewPreVoteRequest(sourceNode state.Node, term int64) *PreVoteRequest
func PreVoteRequestFromBytes ¶
func PreVoteRequestFromBytes(b []byte) *PreVoteRequest
func (*PreVoteRequest) ToBytes ¶
func (p *PreVoteRequest) ToBytes() []byte
type PreVoteResponse ¶
func NewPreVoteResponse ¶
func NewPreVoteResponse(currentTerm int64) *PreVoteResponse
func PreVoteResponseFromBytes ¶
func PreVoteResponseFromBytes(b []byte) *PreVoteResponse
func (*PreVoteResponse) ToBytes ¶
func (p *PreVoteResponse) ToBytes() []byte
type StartJoinRequest ¶
Data Format
func StartJoinRequestFromBytes ¶
func StartJoinRequestFromBytes(b []byte) *StartJoinRequest
func (*StartJoinRequest) ToBytes ¶
func (r *StartJoinRequest) ToBytes() []byte
Click to show internal directories.
Click to hide internal directories.