Documentation ¶
Index ¶
- Variables
- type BinlogClient
- func (c *BinlogClient) IsDrainerTombstone(nodeID string) (bool, error)
- func (c *BinlogClient) IsPumpTombstone(nodeID string) (bool, error)
- func (c *BinlogClient) OfflineDrainer(addr string, nodeID string) error
- func (c *BinlogClient) OfflinePump(addr string, nodeID string) error
- func (c *BinlogClient) UpdateDrainerState(nodeID string, state string) error
- func (c *BinlogClient) UpdatePumpState(nodeID string, state string) error
- type DMMasterClient
- func (dm *DMMasterClient) EvictDMMasterLeader(retryOpt *utils.RetryOption) error
- func (dm *DMMasterClient) GetLeader(retryOpt *utils.RetryOption) (string, error)
- func (dm *DMMasterClient) GetMaster(name string) (isFound bool, isActive bool, isLeader bool, err error)
- func (dm *DMMasterClient) GetRegisteredMembers() ([]string, []string, error)
- func (dm *DMMasterClient) GetURL(addr string) string
- func (dm *DMMasterClient) GetWorker(name string) (string, error)
- func (dm *DMMasterClient) OfflineMaster(name string, retryOpt *utils.RetryOption) error
- func (dm *DMMasterClient) OfflineMember(query string, retryOpt *utils.RetryOption) error
- func (dm *DMMasterClient) OfflineWorker(name string, retryOpt *utils.RetryOption) error
- type NodeStatus
- type PDClient
- func (pc *PDClient) CheckHealth() error
- 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) GetDashboardAddress() (string, 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) IsUp(host string) (bool, error)
- func (pc *PDClient) RemoveStoreEvict(host string) error
- func (pc *PDClient) UpdateReplicateConfig(body io.Reader) error
- func (pc *PDClient) UpdateScheduleConfig(body io.Reader) error
- func (pc *PDClient) WaitLeader(retryOpt *utils.RetryOption) error
- 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.
func (*BinlogClient) UpdateDrainerState ¶ added in v1.0.8
func (c *BinlogClient) UpdateDrainerState(nodeID string, state string) error
UpdateDrainerState update the specify state as the specified state.
func (*BinlogClient) UpdatePumpState ¶ added in v1.0.8
func (c *BinlogClient) UpdatePumpState(nodeID string, state string) error
UpdatePumpState update the specify state as the specified state.
type DMMasterClient ¶
type DMMasterClient struct {
// contains filtered or unexported fields
}
DMMasterClient is an HTTP client of the dm-master server
func NewDMMasterClient ¶
func NewDMMasterClient(addrs []string, timeout time.Duration, tlsConfig *tls.Config) *DMMasterClient
NewDMMasterClient returns a new PDClient
func (*DMMasterClient) EvictDMMasterLeader ¶
func (dm *DMMasterClient) EvictDMMasterLeader(retryOpt *utils.RetryOption) error
EvictDMMasterLeader evicts the dm master leader
func (*DMMasterClient) GetLeader ¶
func (dm *DMMasterClient) GetLeader(retryOpt *utils.RetryOption) (string, error)
GetLeader gets leader of dm cluster
func (*DMMasterClient) GetMaster ¶
func (dm *DMMasterClient) GetMaster(name string) (isFound bool, isActive bool, isLeader bool, err error)
GetMaster returns the dm master leader returns isFound, isActive, isLeader, error
func (*DMMasterClient) GetRegisteredMembers ¶
func (dm *DMMasterClient) GetRegisteredMembers() ([]string, []string, error)
GetRegisteredMembers gets all registerer members of dm cluster
func (*DMMasterClient) GetURL ¶
func (dm *DMMasterClient) GetURL(addr string) string
GetURL builds the the client URL of DMClient
func (*DMMasterClient) GetWorker ¶
func (dm *DMMasterClient) GetWorker(name string) (string, error)
GetWorker returns the dm worker status returns (worker stage, error). If worker stage is "", that means this worker is in cluster
func (*DMMasterClient) OfflineMaster ¶
func (dm *DMMasterClient) OfflineMaster(name string, retryOpt *utils.RetryOption) error
OfflineMaster offlines the dm master
func (*DMMasterClient) OfflineMember ¶
func (dm *DMMasterClient) OfflineMember(query string, retryOpt *utils.RetryOption) error
OfflineMember offlines the member of dm cluster
func (*DMMasterClient) OfflineWorker ¶
func (dm *DMMasterClient) OfflineWorker(name string, retryOpt *utils.RetryOption) error
OfflineWorker offlines the dm worker
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) CheckHealth ¶ added in v1.0.5
CheckHealth checks the health of PD node
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) GetDashboardAddress ¶
GetDashboardAddress get the PD node address which runs dashboard
func (*PDClient) GetMembers ¶
func (pc *PDClient) GetMembers() (*pdpb.GetMembersResponse, error)
GetMembers queries for member list from the PD server
func (*PDClient) GetReplicateConfig ¶
GetReplicateConfig gets the PD replication 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) IsUp ¶ added in v1.0.2
IsUp check if the node is Up state. 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 ¶
UpdateReplicateConfig updates the PD replication config
func (*PDClient) UpdateScheduleConfig ¶ added in v1.0.2
UpdateScheduleConfig updates the PD schedule config
func (*PDClient) WaitLeader ¶
func (pc *PDClient) WaitLeader(retryOpt *utils.RetryOption) error
WaitLeader wait until there's a leader or timeout.
type StatusResp ¶
StatusResp represents the response of status api.