Documentation
¶
Index ¶
- type RaftApplyHandler
- type RaftApplySnapshotHandler
- type RaftFatalEventHandler
- type RaftGetSnapshotHandler
- type RaftGroup
- func (rg *RaftGroup) Apply(command []byte, index uint64) (res interface{}, err error)
- func (rg *RaftGroup) ApplyMemberChange(confChange *raftproto.ConfChange, index uint64) (res interface{}, err error)
- func (rg *RaftGroup) ApplySnapshot(peers []raftproto.Peer, rawIter raftproto.SnapIterator) error
- func (rg *RaftGroup) ChangePeer(ctx context.Context, typ raftproto.ConfChangeType, nodeId uint64) error
- func (rg *RaftGroup) Create(raftConfig *raft.RaftConfig) error
- func (rg *RaftGroup) GetDownPeers(rangeId uint64) []raft.DownReplica
- func (rg *RaftGroup) GetPendingPeers(rangeId uint64) []uint64
- func (rg *RaftGroup) HandleFatalEvent(err *raft.FatalError)
- func (rg *RaftGroup) HandleLeaderChange(leader uint64)
- func (rg *RaftGroup) IsLeader() bool
- func (rg *RaftGroup) LeaderTerm() (leader, term uint64)
- func (rg *RaftGroup) LeaderTransfer(ctx context.Context, rangeId uint64) error
- func (rg *RaftGroup) RegisterApplyHandle(handler RaftApplyHandler)
- func (rg *RaftGroup) RegisterApplySnapshotHandle(handler RaftApplySnapshotHandler)
- func (rg *RaftGroup) RegisterFatalEventHandle(handler RaftFatalEventHandler)
- func (rg *RaftGroup) RegisterGetSnapshotHandle(handler RaftGetSnapshotHandler)
- func (rg *RaftGroup) RegisterLeaderChangeHandle(handler RaftLeaderChangeHandler)
- func (rg *RaftGroup) RegisterPeerChangeHandle(handler RaftPeerChangeHandler)
- func (rg *RaftGroup) Release()
- func (rg *RaftGroup) Snapshot() (raftproto.Snapshot, error)
- func (rg *RaftGroup) Submit(ctx context.Context, cmd []byte) (interface{}, error)
- func (rg *RaftGroup) SubmitCommand(ctx context.Context, req *ms_raftcmdpb.Request) (*ms_raftcmdpb.Response, error)
- type RaftLeaderChangeHandler
- type RaftPeerChangeHandler
- type RaftSnapshot
- type SnapshotKVIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RaftApplyHandler ¶
type RaftApplyHandler func(*ms_raftcmdpb.Request, uint64) (*ms_raftcmdpb.Response, error)
type RaftApplySnapshotHandler ¶
type RaftApplySnapshotHandler func([]raftproto.Peer, *SnapshotKVIterator) error
type RaftFatalEventHandler ¶
type RaftFatalEventHandler func(*raft.FatalError)
type RaftGetSnapshotHandler ¶
type RaftGroup ¶
type RaftGroup struct {
// contains filtered or unexported fields
}
func NewRaftGroup ¶
func NewRaftGroup(id uint64, raftServer *raft.RaftServer, startKey, endKey []byte) *RaftGroup
func (*RaftGroup) ApplyMemberChange ¶
func (rg *RaftGroup) ApplyMemberChange(confChange *raftproto.ConfChange, index uint64) (res interface{}, err error)
func (*RaftGroup) ApplySnapshot ¶
func (*RaftGroup) ChangePeer ¶
func (*RaftGroup) GetDownPeers ¶
func (rg *RaftGroup) GetDownPeers(rangeId uint64) []raft.DownReplica
func (*RaftGroup) GetPendingPeers ¶
func (*RaftGroup) HandleFatalEvent ¶
func (rg *RaftGroup) HandleFatalEvent(err *raft.FatalError)
func (*RaftGroup) HandleLeaderChange ¶
func (*RaftGroup) LeaderTerm ¶
func (*RaftGroup) LeaderTransfer ¶
func (*RaftGroup) RegisterApplyHandle ¶
func (rg *RaftGroup) RegisterApplyHandle(handler RaftApplyHandler)
func (*RaftGroup) RegisterApplySnapshotHandle ¶
func (rg *RaftGroup) RegisterApplySnapshotHandle(handler RaftApplySnapshotHandler)
func (*RaftGroup) RegisterFatalEventHandle ¶
func (rg *RaftGroup) RegisterFatalEventHandle(handler RaftFatalEventHandler)
func (*RaftGroup) RegisterGetSnapshotHandle ¶
func (rg *RaftGroup) RegisterGetSnapshotHandle(handler RaftGetSnapshotHandler)
func (*RaftGroup) RegisterLeaderChangeHandle ¶
func (rg *RaftGroup) RegisterLeaderChangeHandle(handler RaftLeaderChangeHandler)
func (*RaftGroup) RegisterPeerChangeHandle ¶
func (rg *RaftGroup) RegisterPeerChangeHandle(handler RaftPeerChangeHandler)
func (*RaftGroup) SubmitCommand ¶
func (rg *RaftGroup) SubmitCommand(ctx context.Context, req *ms_raftcmdpb.Request) (*ms_raftcmdpb.Response, error)
type RaftLeaderChangeHandler ¶
type RaftLeaderChangeHandler func(uint64)
type RaftPeerChangeHandler ¶
type RaftPeerChangeHandler func(*raftproto.ConfChange) (interface{}, error)
type RaftSnapshot ¶
type RaftSnapshot struct {
// contains filtered or unexported fields
}
func NewRaftSnapshot ¶
func NewRaftSnapshot(snap model.Snapshot, applyIndex uint64, beginKey, endKey []byte) *RaftSnapshot
func (*RaftSnapshot) ApplyIndex ¶
func (s *RaftSnapshot) ApplyIndex() uint64
func (*RaftSnapshot) Close ¶
func (s *RaftSnapshot) Close()
func (*RaftSnapshot) Next ¶
func (s *RaftSnapshot) Next() ([]byte, error)
type SnapshotKVIterator ¶
type SnapshotKVIterator struct {
// contains filtered or unexported fields
}
func NewSnapshotKVIterator ¶
func NewSnapshotKVIterator(rawIter raftproto.SnapIterator) *SnapshotKVIterator
func (*SnapshotKVIterator) Next ¶
func (i *SnapshotKVIterator) Next() (kvPair *ms_raftcmdpb.RaftKvPair, err error)
Click to show internal directories.
Click to hide internal directories.