Documentation ¶
Index ¶
- type HeartbeatStream
- type HeartbeatStreams
- func (s *HeartbeatStreams) BindStream(storeID uint64, stream HeartbeatStream)
- func (s *HeartbeatStreams) Close()
- func (s *HeartbeatStreams) Drain(count int) error
- func (s *HeartbeatStreams) MsgLength() int
- func (s *HeartbeatStreams) SendErr(errType pdpb.ErrorType, errMsg string, targetPeer *metapb.Peer)
- func (s *HeartbeatStreams) SendMsg(region *core.RegionInfo, op *Operation)
- type Operation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeartbeatStream ¶
type HeartbeatStream interface {
Send(core.RegionHeartbeatResponse) error
}
HeartbeatStream is an interface.
type HeartbeatStreams ¶
type HeartbeatStreams struct {
// contains filtered or unexported fields
}
HeartbeatStreams is the bridge of communication with TIKV instance.
func NewHeartbeatStreams ¶
func NewHeartbeatStreams(ctx context.Context, typ string, storeInformer core.StoreSetInformer) *HeartbeatStreams
NewHeartbeatStreams creates a new HeartbeatStreams which enable background running by default.
func NewTestHeartbeatStreams ¶
func NewTestHeartbeatStreams(ctx context.Context, storeInformer core.StoreSetInformer, needRun bool) *HeartbeatStreams
NewTestHeartbeatStreams creates a new HeartbeatStreams for test purpose only. Please use NewHeartbeatStreams for other usage.
func (*HeartbeatStreams) BindStream ¶
func (s *HeartbeatStreams) BindStream(storeID uint64, stream HeartbeatStream)
BindStream binds a stream with a specified store.
func (*HeartbeatStreams) Close ¶
func (s *HeartbeatStreams) Close()
Close closes background running.
func (*HeartbeatStreams) Drain ¶
func (s *HeartbeatStreams) Drain(count int) error
Drain consumes message from msgCh when disable background running. For test only.
func (*HeartbeatStreams) MsgLength ¶
func (s *HeartbeatStreams) MsgLength() int
MsgLength gets the length of msgCh. For test only.
func (*HeartbeatStreams) SendMsg ¶
func (s *HeartbeatStreams) SendMsg(region *core.RegionInfo, op *Operation)
SendMsg sends a message to related store.
type Operation ¶
type Operation struct { ChangePeer *pdpb.ChangePeer // Pd can return transfer_leader to let TiKV does leader transfer itself. TransferLeader *pdpb.TransferLeader Merge *pdpb.Merge // PD sends split_region to let TiKV split a region into two regions. SplitRegion *pdpb.SplitRegion ChangePeerV2 *pdpb.ChangePeerV2 SwitchWitnesses *pdpb.BatchSwitchWitness }
Operation is detailed scheduling step of a region.