Documentation ¶
Index ¶
- Constants
- type Broker
- func (b *Broker) AddPeerToList(peerDataArray []PeerData) error
- func (b *Broker) AppendEntriesLoop(msg api.Message)
- func (b *Broker) AppendEntriesRPC(args *api.AppendEntriesArgs, reply *api.AppendEntriesReply) error
- func (b *Broker) AppendTopicLoop()
- func (b *Broker) AppendTopicRPC(args *api.AppendTopicArgs, reply *api.AppendTopicReply) error
- func (b *Broker) CheckIfPeerAlreadyInList(peer []PeerData) bool
- func (b *Broker) ClearCluster() error
- func (b *Broker) Consume(fetchReq api.FetchMessage) (api.Message, error)
- func (b *Broker) CreateTopic(name string, replicationFactor int, partitionCount int) error
- func (b *Broker) GetPeerList() ([]PeerData, error)
- func (b *Broker) GetPeers() []Peer
- func (b *Broker) InitPeers()
- func (b *Broker) PeerRefreshLoop()
- func (b *Broker) PrintRPC(args *int, reply *int) error
- func (b *Broker) Produce(msg api.Message) error
- func (b *Broker) Start()
- func (b *Broker) StartRPCServer(wg *sync.WaitGroup)
- func (b *Broker) StartServer()
- type BrokerOpts
- type CreateTopicRequest
- type Peer
- type PeerData
Constants ¶
View Source
const ( LEADER = "leader" FOLLOWER = "follower" CANDIDATE = "candidate" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct { Name string Peers []Peer Topics []*topic.Topic Id int Role string CurrentTerm int VotedFor int // contains filtered or unexported fields }
func NewBroker ¶
func NewBroker(opts BrokerOpts) (*Broker, error)
func (*Broker) AddPeerToList ¶
Adds peer to list
func (*Broker) AppendEntriesLoop ¶
func (*Broker) AppendEntriesRPC ¶
func (b *Broker) AppendEntriesRPC(args *api.AppendEntriesArgs, reply *api.AppendEntriesReply) error
func (*Broker) AppendTopicLoop ¶
func (b *Broker) AppendTopicLoop()
func (*Broker) AppendTopicRPC ¶
func (b *Broker) AppendTopicRPC(args *api.AppendTopicArgs, reply *api.AppendTopicReply) error
func (*Broker) CheckIfPeerAlreadyInList ¶
Checks if peer is already in maintained list
func (*Broker) CreateTopic ¶
CreateTopic creates a new topic
func (*Broker) GetPeerList ¶
Equivalent of GetPeers function
func (*Broker) PeerRefreshLoop ¶
func (b *Broker) PeerRefreshLoop()
Keeps checking if new peers have been added in the kv store
func (*Broker) StartRPCServer ¶
Starts the server for raft related RPC calls
func (*Broker) StartServer ¶
func (b *Broker) StartServer()
type BrokerOpts ¶
type CreateTopicRequest ¶
Click to show internal directories.
Click to hide internal directories.