@@ -34,6 +34,7 @@ import (
3434 "github.com/tikv/pd/pkg/schedule/diagnostic"
3535 "github.com/tikv/pd/pkg/schedule/hbstream"
3636 "github.com/tikv/pd/pkg/schedule/operator"
37+ "github.com/tikv/pd/pkg/schedule/preparecheck"
3738 "github.com/tikv/pd/pkg/schedule/scatter"
3839 "github.com/tikv/pd/pkg/schedule/schedulers"
3940 "github.com/tikv/pd/pkg/schedule/splitter"
@@ -46,9 +47,7 @@ import (
4647
4748const (
4849 runSchedulerCheckInterval = 3 * time .Second
49- // collectTimeout is the timeout for collecting regions.
50- collectTimeout = 5 * time .Minute
51- maxLoadConfigRetries = 10
50+ maxLoadConfigRetries = 10
5251 // pushOperatorTickInterval is the interval try to push the operator.
5352 pushOperatorTickInterval = 500 * time .Millisecond
5453
@@ -69,7 +68,7 @@ type Coordinator struct {
6968 schedulersInitialized bool
7069
7170 cluster sche.ClusterInformer
72- prepareChecker * prepareChecker
71+ prepareChecker * preparecheck. Checker
7372 checkers * checker.Controller
7473 regionScatterer * scatter.RegionScatterer
7574 regionSplitter * splitter.RegionSplitter
@@ -83,7 +82,7 @@ type Coordinator struct {
8382// NewCoordinator creates a new Coordinator.
8483func NewCoordinator (parentCtx context.Context , cluster sche.ClusterInformer , hbStreams * hbstream.HeartbeatStreams ) * Coordinator {
8584 ctx , cancel := context .WithCancel (parentCtx )
86- prepareChecker := newPrepareChecker (cluster .GetPrepareRegionCount )
85+ prepareChecker := preparecheck . NewChecker (cluster .GetPrepareRegionCount )
8786 opController := operator .NewController (ctx , cluster .GetBasicCluster (), cluster .GetSharedConfig (), hbStreams )
8887 schedulers := schedulers .NewController (ctx , cluster , cluster .GetStorage (), opController , prepareChecker )
8988 checkers := checker .NewController (ctx , cluster , opController , prepareChecker )
@@ -641,7 +640,7 @@ func (c *Coordinator) GetRuleChecker() *checker.RuleChecker {
641640}
642641
643642// GetPrepareChecker returns the prepare checker.
644- func (c * Coordinator ) GetPrepareChecker () * prepareChecker {
643+ func (c * Coordinator ) GetPrepareChecker () * preparecheck. Checker {
645644 return c .prepareChecker
646645}
647646
0 commit comments