cse

package module
v0.0.0-...-f4c9c80 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 30 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 InitMetrics(namespace, subsystem string, constLabels map[string]string)

func NewClient

func NewClient(origin pd.Client, tlsConfig *tls.Config, cbOpt *CBOptions) (pd.Client, error)

func NewClientWithFallback

func NewClientWithFallback(client pd.Client, tlsConfig *tls.Config, cbOpt *CBOptions) (pd.Client, error)

func RegisterMetrics

func RegisterMetrics()

Types

type CBOptions

type CBOptions struct {
	Interval         time.Duration
	Timeout          time.Duration
	ProbeMinInterval time.Duration
	ProbeMaxInterval time.Duration
	ReadyToTrip      func(counts gobreaker.Counts) bool
}

CBOptions is a wrapper for gobreaker settings.

type Client

type Client struct {
	pd.Client
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close()

func (*Client) GetAllStores

func (c *Client) GetAllStores(context.Context, ...opt.GetStoreOption) ([]*metapb.Store, error)

GetAllStores returns all stores in the cluster except tombstone stores.

func (*Client) GetPrevRegion

func (c *Client) GetPrevRegion(ctx context.Context, key []byte, _ ...opt.GetRegionOption) (*router.Region, error)

func (*Client) GetRegion

func (c *Client) GetRegion(ctx context.Context, key []byte, _ ...opt.GetRegionOption) (*router.Region, error)

func (*Client) GetRegionByID

func (c *Client) GetRegionByID(ctx context.Context, regionID uint64, _ ...opt.GetRegionOption) (*router.Region, error)

func (*Client) GetStore

func (c *Client) GetStore(_ context.Context, storeID uint64) (*metapb.Store, error)

func (*Client) ScanRegions

func (c *Client) ScanRegions(ctx context.Context, startKey, endKey []byte, limit int, _ ...opt.GetRegionOption) ([]*router.Region, error)

type ClientWithFallback

type ClientWithFallback struct {
	pd.Client
	// contains filtered or unexported fields
}

func (*ClientWithFallback) Close

func (f *ClientWithFallback) Close()

func (*ClientWithFallback) GetAllStores

func (f *ClientWithFallback) GetAllStores(ctx context.Context, opts ...opt.GetStoreOption) ([]*metapb.Store, error)

func (*ClientWithFallback) GetPrevRegion

func (f *ClientWithFallback) GetPrevRegion(ctx context.Context, key []byte, opts ...opt.GetRegionOption) (*router.Region, error)

func (*ClientWithFallback) GetRegion

func (f *ClientWithFallback) GetRegion(ctx context.Context, key []byte, opts ...opt.GetRegionOption) (*router.Region, error)

func (*ClientWithFallback) GetRegionByID

func (f *ClientWithFallback) GetRegionByID(ctx context.Context, regionID uint64, opts ...opt.GetRegionOption) (*router.Region, error)

func (*ClientWithFallback) GetStore

func (f *ClientWithFallback) GetStore(ctx context.Context, storeID uint64) (*metapb.Store, error)

func (*ClientWithFallback) ScanRegions

func (f *ClientWithFallback) ScanRegions(ctx context.Context, key, endKey []byte, limit int, opts ...opt.GetRegionOption) ([]*router.Region, error)

type SyncRegionByIDRequest

type SyncRegionByIDRequest struct {
	RegionID uint64 `json:"region-id"`
}

type SyncRegionRequest

type SyncRegionRequest struct {
	Start   string `json:"start"`
	End     string `json:"end"`
	Limit   uint64 `json:"limit"`
	Reverse bool   `json:"reverse"`
}

Jump to

Keyboard shortcuts

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