From 2ece802ca3627b1efe9c5c9b3ddc916d9c2b9082 Mon Sep 17 00:00:00 2001 From: lhy1024 Date: Mon, 7 Aug 2023 13:53:25 +0800 Subject: [PATCH] fix conflict Signed-off-by: lhy1024 --- pkg/schedule/schedulers/hot_region.go | 31 ++----------------- pkg/schedule/schedulers/hot_region_v2_test.go | 7 ++--- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/pkg/schedule/schedulers/hot_region.go b/pkg/schedule/schedulers/hot_region.go index 18bf33cb98b..f5e3ff0bb6e 100644 --- a/pkg/schedule/schedulers/hot_region.go +++ b/pkg/schedule/schedulers/hot_region.go @@ -439,23 +439,14 @@ func isAvailableV1(s *solution) bool { } type balanceSolver struct { -<<<<<<< HEAD schedule.Cluster sche *hotScheduler stLoadDetail map[uint64]*statistics.StoreLoadDetail + filteredHotPeers map[uint64][]*statistics.HotPeerStat // storeID -> hotPeers(filtered) + nthHotPeer map[uint64][]*statistics.HotPeerStat // storeID -> [dimLen]hotPeers rwTy statistics.RWType opTy opType resourceTy resourceType -======= - sche.SchedulerCluster - sche *hotScheduler - stLoadDetail map[uint64]*statistics.StoreLoadDetail - filteredHotPeers map[uint64][]*statistics.HotPeerStat // storeID -> hotPeers(filtered) - nthHotPeer map[uint64][]*statistics.HotPeerStat // storeID -> [dimLen]hotPeers - rwTy statistics.RWType - opTy opType - resourceTy resourceType ->>>>>>> 16926ad89 (scheduler: make hot v2 more suitable small hot region (#6827)) cur *solution @@ -497,7 +488,7 @@ func (bs *balanceSolver) init() { // Load the configuration items of the scheduler. bs.resourceTy = toResourceType(bs.rwTy, bs.opTy) bs.maxPeerNum = bs.sche.conf.GetMaxPeerNumber() - bs.minHotDegree = bs.GetSchedulerConfig().GetHotRegionCacheHitsThreshold() + bs.minHotDegree = bs.GetOpts().GetHotRegionCacheHitsThreshold() bs.firstPriority, bs.secondPriority = prioritiesToDim(bs.getPriorities()) bs.greatDecRatio, bs.minorDecRatio = bs.sche.conf.GetGreatDecRatio(), bs.sche.conf.GetMinorDecRatio() bs.isRaftKV2 = bs.GetStoreConfig().IsRaftKV2() @@ -543,22 +534,6 @@ func (bs *balanceSolver) init() { Loads: stepLoads, Count: maxCur.Count * bs.sche.conf.GetCountRankStepRatio(), } -<<<<<<< HEAD - - bs.firstPriority, bs.secondPriority = prioritiesToDim(bs.getPriorities()) - bs.greatDecRatio, bs.minorDecRatio = bs.sche.conf.GetGreatDecRatio(), bs.sche.conf.GetMinorDecRatio() - bs.maxPeerNum = bs.sche.conf.GetMaxPeerNumber() - bs.minHotDegree = bs.GetOpts().GetHotRegionCacheHitsThreshold() - bs.isRaftKV2 = bs.GetStoreConfig().IsRaftKV2() - - switch bs.sche.conf.GetRankFormulaVersion() { - case "v1": - bs.initRankV1() - default: - bs.initRankV2() - } -======= ->>>>>>> 16926ad89 (scheduler: make hot v2 more suitable small hot region (#6827)) } func (bs *balanceSolver) initRankV1() { diff --git a/pkg/schedule/schedulers/hot_region_v2_test.go b/pkg/schedule/schedulers/hot_region_v2_test.go index 626ccfc1a68..14ec3edca8b 100644 --- a/pkg/schedule/schedulers/hot_region_v2_test.go +++ b/pkg/schedule/schedulers/hot_region_v2_test.go @@ -19,11 +19,8 @@ import ( "github.com/docker/go-units" "github.com/stretchr/testify/require" -<<<<<<< HEAD - "github.com/tikv/pd/pkg/schedule" -======= "github.com/tikv/pd/pkg/mock/mockcluster" ->>>>>>> 16926ad89 (scheduler: make hot v2 more suitable small hot region (#6827)) + "github.com/tikv/pd/pkg/schedule" "github.com/tikv/pd/pkg/schedule/operator" "github.com/tikv/pd/pkg/statistics" "github.com/tikv/pd/pkg/storage" @@ -439,7 +436,7 @@ func checkHotReadRegionScheduleWithSmallHotRegion(re *require.Assertions, highLo cancel, _, tc, oc := prepareSchedulersTest() defer cancel() statistics.Denoising = false - sche, err := CreateScheduler(statistics.Read.String(), oc, storage.NewStorageWithMemoryBackend(), nil, nil) + sche, err := schedule.CreateScheduler(statistics.Read.String(), oc, storage.NewStorageWithMemoryBackend(), nil) re.NoError(err) hb := sche.(*hotScheduler) hb.conf.SetSrcToleranceRatio(1)