Documentation
¶
Index ¶
- func NewRaftNode(id int, peers []string, joined bool, generateSnapshot func() ([]byte, error)) (proposeC chan string, confChangeC chan raftpb.ConfChange, ...)
- type Cluster
- type DataCenter
- type Dataer
- type Host
- type Indexer
- type Rack
- type RaftNode
- func (_this *RaftNode) GenerateSnapshot(data interface{}) ([]byte, error)
- func (_this *RaftNode) IsIDRemoved(id uint64) bool
- func (_this *RaftNode) Process(ctx context.Context, m raftpb.Message) error
- func (_this *RaftNode) Propose(data interface{}) (err error)
- func (_this *RaftNode) ProposeConfChange(confChangeType raftpb.ConfChangeType, nodeID uint64, url []byte) (err error)
- func (_this *RaftNode) ReadCommits(commitC <-chan *string, errorC <-chan error, data interface{})
- func (_this *RaftNode) RecoverFromSnapshot(snapshot []byte, data interface{}) error
- func (_this *RaftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus)
- func (_this *RaftNode) ReportUnreachable(id uint64)
- type StoppableListener
- type Storer
- type Volumer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRaftNode ¶
func NewRaftNode(id int, peers []string, joined bool, generateSnapshot func() ([]byte, error)) (proposeC chan string, confChangeC chan raftpb.ConfChange, commitC chan<- *string, errorC chan<- error, snapshotterReady <-chan *snap.Snapshotter)
NewRaftNode - ======== NewRaftNode() ======== NewRaftNode initializes a raft instance and returns a committed log entry channel and error channel. Proposals for log updates are sent over the provided the proposal channel. All log entries are replayed over the commit channel, followed by a nil message (to indicate the channel is current), then new log entries. To shutdown, close proposeC and read errorC. func NewRaftNode(id int, peers []string, joined bool, generateSnapshot func() ([]byte, error), proposeC <-chan string, confChangeC <-chan raftpb.ConfChange) (commitC chan<- *string, errorC chan<- error, snapshotterReady <-chan *snap.Snapshotter) {
Types ¶
type Cluster ¶
type Cluster struct {
DataCenters []*DataCenter
}
**************** Cluster ****************
type DataCenter ¶
type DataCenter struct {
Racks []*Rack
}
**************** DataCenter ****************
type RaftNode ¶
type RaftNode struct {
// contains filtered or unexported fields
}
RaftNode ******************************** Distributed node backed by raft.
func (*RaftNode) GenerateSnapshot ¶
GenerateSnapshot () ======== RaftNode::GenerateSnapshot() ========
func (*RaftNode) IsIDRemoved ¶
IsIDRemoved - ======== RaftNode::IsIDRemoved() ========
func (*RaftNode) ProposeConfChange ¶
func (_this *RaftNode) ProposeConfChange(confChangeType raftpb.ConfChangeType, nodeID uint64, url []byte) (err error)
ProposeConfChange () ======== ProposeConfChange() ========
func (*RaftNode) ReadCommits ¶
ReadCommits () ======== RaftNode::ReadCommits() ========
func (*RaftNode) RecoverFromSnapshot ¶
RecoverFromSnapshot () ======== RaftNode::RecoverFromSnapshot() ========
func (*RaftNode) ReportSnapshot ¶
func (_this *RaftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus)
ReportSnapshot - ======== RaftNode()::ReportSnapshot() ========
func (*RaftNode) ReportUnreachable ¶
ReportUnreachable - ======== RaftNode::ReportUnreachable() ========
type StoppableListener ¶
type StoppableListener struct {
*net.TCPListener
// contains filtered or unexported fields
}
StoppableListener - **************** StoppableListener ****************
func NewStoppableListener ¶
func NewStoppableListener(addr string, stopc <-chan struct{}) (*StoppableListener, error)
NewStoppableListener - ======== NewStoppableListener() ========