Documentation ¶
Index ¶
- Variables
- type BinlogClient
- type NodeStatus
- type PDClient
- func (pc *PDClient) DelPD(name string, retryOpt *utils.RetryOption) error
- func (pc *PDClient) DelStore(host string, retryOpt *utils.RetryOption) error
- func (pc *PDClient) EvictPDLeader(retryOpt *utils.RetryOption) error
- func (pc *PDClient) EvictStoreLeader(host string, retryOpt *utils.RetryOption) error
- func (pc *PDClient) GetHealth() (*PDHealthInfo, error)
- func (pc *PDClient) GetLeader() (*pdpb.Member, error)
- func (pc *PDClient) GetMembers() (*pdpb.GetMembersResponse, error)
- func (pc *PDClient) GetReplicateConfig() ([]byte, error)
- func (pc *PDClient) GetStores() (*pdserverapi.StoresInfo, error)
- func (pc *PDClient) GetURL(addr string) string
- func (pc *PDClient) IsTombStone(host string) (bool, error)
- func (pc *PDClient) RemoveStoreEvict(host string) error
- func (pc *PDClient) UpdateReplicateConfig(body io.Reader) error
- func (pc *PDClient) WaitLeader(retryOpt *utils.RetryOption) error
- type PDHealthInfo
- type StatusResp
Constants ¶
This section is empty.
Variables ¶
var ErrStoreNotExists = errors.New("store not exists")
ErrStoreNotExists represents the store not exists.
Functions ¶
This section is empty.
Types ¶
type BinlogClient ¶
type BinlogClient struct {
// contains filtered or unexported fields
}
BinlogClient is the client of binlog.
func NewBinlogClient ¶
func NewBinlogClient(pdEndpoint []string, tlsConfig *tls.Config) (*BinlogClient, error)
NewBinlogClient create a BinlogClient.
func (*BinlogClient) IsDrainerTombstone ¶
func (c *BinlogClient) IsDrainerTombstone(nodeID string) (bool, error)
IsDrainerTombstone check if drainer is tombstone.
func (*BinlogClient) IsPumpTombstone ¶
func (c *BinlogClient) IsPumpTombstone(nodeID string) (bool, error)
IsPumpTombstone check if drainer is tombstone.
func (*BinlogClient) OfflineDrainer ¶
func (c *BinlogClient) OfflineDrainer(addr string, nodeID string) error
OfflineDrainer offline a drainer.
func (*BinlogClient) OfflinePump ¶
func (c *BinlogClient) OfflinePump(addr string, nodeID string) error
OfflinePump offline a pump.
type NodeStatus ¶
type NodeStatus struct { NodeID string `json:"nodeId"` Addr string `json:"host"` State string `json:"state"` MaxCommitTS int64 `json:"maxCommitTS"` UpdateTS int64 `json:"updateTS"` }
NodeStatus represents the status saved in etcd.
type PDClient ¶
type PDClient struct {
// contains filtered or unexported fields
}
PDClient is an HTTP client of the PD server
func NewPDClient ¶
NewPDClient returns a new PDClient
func (*PDClient) DelPD ¶
func (pc *PDClient) DelPD(name string, retryOpt *utils.RetryOption) error
DelPD deletes a PD node from the cluster, name is the Name of the PD member
func (*PDClient) DelStore ¶
func (pc *PDClient) DelStore(host string, retryOpt *utils.RetryOption) error
DelStore deletes stores from a (TiKV) host The host parameter should be in format of IP:Port, that matches store's address
func (*PDClient) EvictPDLeader ¶
func (pc *PDClient) EvictPDLeader(retryOpt *utils.RetryOption) error
EvictPDLeader evicts the PD leader
func (*PDClient) EvictStoreLeader ¶
func (pc *PDClient) EvictStoreLeader(host string, retryOpt *utils.RetryOption) error
EvictStoreLeader evicts the store leaders The host parameter should be in format of IP:Port, that matches store's address
func (*PDClient) GetHealth ¶
func (pc *PDClient) GetHealth() (*PDHealthInfo, error)
GetHealth queries the health info from PD server
func (*PDClient) GetMembers ¶
func (pc *PDClient) GetMembers() (*pdpb.GetMembersResponse, error)
GetMembers queries for member list from the PD server
func (*PDClient) GetReplicateConfig ¶ added in v1.0.0
GetReplicateConfig gets the PD replicate config
func (*PDClient) GetStores ¶
func (pc *PDClient) GetStores() (*pdserverapi.StoresInfo, error)
GetStores queries the stores info from PD server
func (*PDClient) IsTombStone ¶
IsTombStone check if the node is Tombstone. The host parameter should be in format of IP:Port, that matches store's address
func (*PDClient) RemoveStoreEvict ¶
RemoveStoreEvict removes a store leader evict scheduler, which allows following leaders to be transffered to it again.
func (*PDClient) UpdateReplicateConfig ¶ added in v0.6.2
UpdateReplicateConfig updates the PD replicate config
func (*PDClient) WaitLeader ¶
func (pc *PDClient) WaitLeader(retryOpt *utils.RetryOption) error
WaitLeader wait until there's a leader or timeout.
type PDHealthInfo ¶
type PDHealthInfo struct {
Healths []pdserverapi.Health
}
PDHealthInfo is the member health info from PD's API
type StatusResp ¶
StatusResp represents the response of status api.