Skip to content

Commit

Permalink
remove debug log
Browse files Browse the repository at this point in the history
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
  • Loading branch information
CabinfeverB committed Mar 14, 2022
1 parent b165436 commit 9a32d17
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions server/schedulers/balance_leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,6 @@ func (cs *candidateStores) reSort(stores ...*core.StoreInfo) {
}
}

func leaderScore(store *core.StoreInfo, plan *balancePlan) float64 {
influence := plan.GetOpInfluence(store.GetID())
return store.LeaderScore(plan.kind.Policy, influence)
}

func (l *balanceLeaderScheduler) Schedule(cluster schedule.Cluster) []*operator.Operator {
schedulerCounter.WithLabelValues(l.GetName(), "schedule").Inc()

Expand All @@ -207,12 +202,18 @@ func (l *balanceLeaderScheduler) Schedule(cluster schedule.Cluster) []*operator.
stores := cluster.GetStores()
greaterOption := func(stores []*core.StoreInfo) func(int, int) bool {
return func(i, j int) bool {
return leaderScore(stores[i], plan) > leaderScore(stores[j], plan)
iOp := plan.GetOpInfluence(stores[i].GetID())
jOp := plan.GetOpInfluence(stores[j].GetID())
return stores[i].LeaderScore(plan.kind.Policy, iOp) >
stores[j].LeaderScore(plan.kind.Policy, jOp)
}
}
lessOption := func(stores []*core.StoreInfo) func(int, int) bool {
return func(i, j int) bool {
return leaderScore(stores[i], plan) < leaderScore(stores[j], plan)
iOp := plan.GetOpInfluence(stores[i].GetID())
jOp := plan.GetOpInfluence(stores[j].GetID())
return stores[i].LeaderScore(plan.kind.Policy, iOp) <
stores[j].LeaderScore(plan.kind.Policy, jOp)
}
}
sourceCandidate := newCandidateStores(filter.SelectSourceStores(stores, l.filters, cluster.GetOpts()), greaterOption)
Expand Down Expand Up @@ -253,7 +254,6 @@ func createTransferLeaderOperator(cs *candidateStores, dir string, l *balanceLea
store := cs.getStore()
retryLimit := l.retryQuota.GetLimit(store)
var creator func(*balancePlan) *operator.Operator
log.Debug("store leader score", zap.String("scheduler", l.GetName()), zap.Uint64(dir, store.GetID()), zap.Float64("score", leaderScore(store, plan)))
switch dir {
case transferOut:
plan.source, plan.target = store, nil
Expand Down

0 comments on commit 9a32d17

Please sign in to comment.