Documentation
¶
Index ¶
- Variables
- func InitMetrics(namespace, subsystem string, constLabels map[string]string)
- func NewClient(origin pd.Client, tlsConfig *tls.Config, cbOpt *CBOptions) (pd.Client, error)
- func NewClientWithFallback(client pd.Client, tlsConfig *tls.Config, cbOpt *CBOptions) (pd.Client, error)
- func RegisterMetrics()
- type CBOptions
- type Client
- func (c *Client) Close()
- func (c *Client) GetAllStores(context.Context, ...pd.GetStoreOption) ([]*metapb.Store, error)
- func (c *Client) GetPrevRegion(ctx context.Context, key []byte, _ ...pd.GetRegionOption) (*pd.Region, error)
- func (c *Client) GetRegion(ctx context.Context, key []byte, _ ...pd.GetRegionOption) (*pd.Region, error)
- func (c *Client) GetRegionByID(ctx context.Context, regionID uint64, _ ...pd.GetRegionOption) (*pd.Region, error)
- func (c *Client) GetStore(_ context.Context, storeID uint64) (*metapb.Store, error)
- func (c *Client) ScanRegions(ctx context.Context, startKey, endKey []byte, limit int, ...) ([]*pd.Region, error)
- type ClientWithFallback
- func (f *ClientWithFallback) Close()
- func (f *ClientWithFallback) GetAllStores(ctx context.Context, opts ...pd.GetStoreOption) ([]*metapb.Store, error)
- func (f *ClientWithFallback) GetPrevRegion(ctx context.Context, key []byte, opts ...pd.GetRegionOption) (*pd.Region, error)
- func (f *ClientWithFallback) GetRegion(ctx context.Context, key []byte, opts ...pd.GetRegionOption) (*pd.Region, error)
- func (f *ClientWithFallback) GetRegionByID(ctx context.Context, regionID uint64, opts ...pd.GetRegionOption) (*pd.Region, error)
- func (f *ClientWithFallback) GetStore(ctx context.Context, storeID uint64) (*metapb.Store, error)
- func (f *ClientWithFallback) ScanRegions(ctx context.Context, key, endKey []byte, limit int, opts ...pd.GetRegionOption) ([]*pd.Region, error)
- type SyncRegionByIDRequest
- type SyncRegionRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( StoresRefreshInterval = time.Second * 5 SyncRegionTimeout = time.Second * 2 )
View Source
var (
ErrRegionNotFound = errors.New("region not found")
)
View Source
var (
TiKVSyncRegionDuration *prometheus.HistogramVec
)
Functions ¶
func InitMetrics ¶
func NewClientWithFallback ¶
func RegisterMetrics ¶
func RegisterMetrics()
Types ¶
type CBOptions ¶
type CBOptions struct { Interval time.Duration Timeout time.Duration ProbeInterval time.Duration ReadyToTrip func(counts gobreaker.Counts) bool }
CBOptions is a wrapper for gobreaker settings.
type Client ¶
func (*Client) GetAllStores ¶
GetAllStores returns all stores in the cluster except tombstone stores.
func (*Client) GetPrevRegion ¶
func (*Client) GetRegionByID ¶
type ClientWithFallback ¶
func (*ClientWithFallback) Close ¶
func (f *ClientWithFallback) Close()
func (*ClientWithFallback) GetAllStores ¶
func (f *ClientWithFallback) GetAllStores(ctx context.Context, opts ...pd.GetStoreOption) ([]*metapb.Store, error)
func (*ClientWithFallback) GetPrevRegion ¶
func (f *ClientWithFallback) GetPrevRegion(ctx context.Context, key []byte, opts ...pd.GetRegionOption) (*pd.Region, error)
func (*ClientWithFallback) GetRegion ¶
func (f *ClientWithFallback) GetRegion(ctx context.Context, key []byte, opts ...pd.GetRegionOption) (*pd.Region, error)
func (*ClientWithFallback) GetRegionByID ¶
func (f *ClientWithFallback) GetRegionByID(ctx context.Context, regionID uint64, opts ...pd.GetRegionOption) (*pd.Region, error)
func (*ClientWithFallback) ScanRegions ¶
func (f *ClientWithFallback) ScanRegions(ctx context.Context, key, endKey []byte, limit int, opts ...pd.GetRegionOption) ([]*pd.Region, error)
type SyncRegionByIDRequest ¶
type SyncRegionByIDRequest struct {
RegionID uint64 `json:"region-id"`
}
Click to show internal directories.
Click to hide internal directories.