Documentation ¶
Index ¶
- Variables
- type FakePDClient
- func (fpdc *FakePDClient) BatchScanRegions(ctx context.Context, ranges []pd.KeyRange, limit int, ...) ([]*pd.Region, error)
- func (fpdc *FakePDClient) GetAllStores(context.Context, ...pd.GetStoreOption) ([]*metapb.Store, error)
- func (fpdc *FakePDClient) GetTS(ctx context.Context) (int64, int64, error)
- func (fpdc *FakePDClient) ScanRegions(ctx context.Context, key, endKey []byte, limit int, opts ...pd.GetRegionOption) ([]*pd.Region, error)
- func (fpdc *FakePDClient) SetRegions(regions []*pd.Region)
- type FakePDHTTPClient
- func (fpdh *FakePDHTTPClient) DeletePlacementRule(_ context.Context, groupID string, ruleID string) error
- func (fpdh *FakePDHTTPClient) GetConfig(_ context.Context) (map[string]any, error)
- func (fpdh *FakePDHTTPClient) GetDelaySchedulers() map[string]struct{}
- func (fpdh *FakePDHTTPClient) GetPlacementRule(_ context.Context, groupID string, ruleID string) (*pdhttp.Rule, error)
- func (fpdh *FakePDHTTPClient) GetScheduleConfig(_ context.Context) (map[string]any, error)
- func (fpdh *FakePDHTTPClient) GetSchedulers(_ context.Context) ([]string, error)
- func (fpdh *FakePDHTTPClient) SetConfig(_ context.Context, config map[string]any, ttl ...float64) error
- func (fpdh *FakePDHTTPClient) SetPlacementRule(_ context.Context, rule *pdhttp.Rule) error
- func (fpdh *FakePDHTTPClient) SetSchedulerDelay(_ context.Context, key string, delay int64) error
- type FakeSplitClient
- func (f *FakeSplitClient) AppendPdRegion(region *pd.Region)
- func (f *FakeSplitClient) AppendRegion(startKey, endKey []byte)
- func (f *FakeSplitClient) ScanRegions(ctx context.Context, startKey, endKey []byte, limit int) ([]*split.RegionInfo, error)
- func (f *FakeSplitClient) WaitRegionsScattered(context.Context, []*split.RegionInfo) (int, error)
- type TestRestoreSchemaSuite
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ExpectPDCfgGeneratorsResult = map[string]any{ "merge-schedule-limit": 0, "leader-schedule-limit": float64(40), "region-schedule-limit": float64(40), "max-snapshot-count": float64(40), "enable-location-replacement": "false", "max-pending-peer-count": uint64(math.MaxInt32), } ExistPDCfgGeneratorBefore = map[string]any{ "merge-schedule-limit": 100, "leader-schedule-limit": float64(100), "region-schedule-limit": float64(100), "max-snapshot-count": float64(100), "enable-location-replacement": "true", "max-pending-peer-count": 100, } )
View Source
var DefaultTestKeepaliveCfg = keepalive.ClientParameters{ Time: 3 * time.Second, Timeout: 10 * time.Second, }
Functions ¶
This section is empty.
Types ¶
type FakePDClient ¶
func NewFakePDClient ¶
func NewFakePDClient(stores []*metapb.Store, notLeader bool, retryTime *int) *FakePDClient
func (*FakePDClient) BatchScanRegions ¶
func (*FakePDClient) GetAllStores ¶
func (fpdc *FakePDClient) GetAllStores(context.Context, ...pd.GetStoreOption) ([]*metapb.Store, error)
func (*FakePDClient) ScanRegions ¶
func (fpdc *FakePDClient) ScanRegions( ctx context.Context, key, endKey []byte, limit int, opts ...pd.GetRegionOption, ) ([]*pd.Region, error)
func (*FakePDClient) SetRegions ¶
func (fpdc *FakePDClient) SetRegions(regions []*pd.Region)
type FakePDHTTPClient ¶
func NewFakePDHTTPClient ¶
func NewFakePDHTTPClient() *FakePDHTTPClient
func (*FakePDHTTPClient) DeletePlacementRule ¶
func (*FakePDHTTPClient) GetDelaySchedulers ¶
func (fpdh *FakePDHTTPClient) GetDelaySchedulers() map[string]struct{}
func (*FakePDHTTPClient) GetPlacementRule ¶
func (*FakePDHTTPClient) GetScheduleConfig ¶
func (*FakePDHTTPClient) GetSchedulers ¶
func (fpdh *FakePDHTTPClient) GetSchedulers(_ context.Context) ([]string, error)
func (*FakePDHTTPClient) SetPlacementRule ¶
func (*FakePDHTTPClient) SetSchedulerDelay ¶
type FakeSplitClient ¶
type FakeSplitClient struct { split.SplitClient // contains filtered or unexported fields }
func NewFakeSplitClient ¶
func NewFakeSplitClient() *FakeSplitClient
func (*FakeSplitClient) AppendPdRegion ¶
func (f *FakeSplitClient) AppendPdRegion(region *pd.Region)
func (*FakeSplitClient) AppendRegion ¶
func (f *FakeSplitClient) AppendRegion(startKey, endKey []byte)
func (*FakeSplitClient) ScanRegions ¶
func (f *FakeSplitClient) ScanRegions( ctx context.Context, startKey, endKey []byte, limit int, ) ([]*split.RegionInfo, error)
func (*FakeSplitClient) WaitRegionsScattered ¶
func (f *FakeSplitClient) WaitRegionsScattered(context.Context, []*split.RegionInfo) (int, error)
type TestRestoreSchemaSuite ¶
type TestRestoreSchemaSuite struct { Mock *mock.Cluster MockGlue *gluemock.MockGlue Storage storage.ExternalStorage }
func CreateRestoreSchemaSuite ¶
func CreateRestoreSchemaSuite(t *testing.T) *TestRestoreSchemaSuite
Click to show internal directories.
Click to hide internal directories.