api

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func NewPDClient(addrs []string, timeout time.Duration, tlsConfig *tls.Config) *PDClient

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) GetLeader

func (pc *PDClient) GetLeader() (*pdpb.Member, error)

GetLeader queries the leader node of PD cluster

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

func (pc *PDClient) GetReplicateConfig() ([]byte, error)

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) GetURL

func (pc *PDClient) GetURL(addr string) string

GetURL builds the the client URL of PDClient

func (*PDClient) IsTombStone

func (pc *PDClient) IsTombStone(host string) (bool, error)

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

func (pc *PDClient) RemoveStoreEvict(host string) error

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

func (pc *PDClient) UpdateReplicateConfig(body io.Reader) error

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

type StatusResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

StatusResp represents the response of status api.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL