Skip to content

Commit 2f374b3

Browse files
committed
mmaprototype: move unused constraint functions to _test.go file
They are being used from tests. Make this clearer by making these functions available only in the test. If we decide to actually use them in production, they can be moved back.
1 parent 9b5259c commit 2f374b3

File tree

4 files changed

+1
-15
lines changed

4 files changed

+1
-15
lines changed

pkg/kv/kvserver/allocator/mmaprototype/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ go_library(
99
"cluster_state_rebalance_stores.go",
1010
"constraint.go",
1111
"constraint_matcher.go",
12-
"constraint_unused.go",
1312
"doc.go",
1413
"load.go",
1514
"memo_helper.go",
@@ -44,6 +43,7 @@ go_test(
4443
"cluster_state_test.go",
4544
"constraint_matcher_test.go",
4645
"constraint_test.go",
46+
"constraint_unused_test.go",
4747
"load_test.go",
4848
"memo_helper_test.go",
4949
],

pkg/kv/kvserver/allocator/mmaprototype/constraint.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,15 +1564,7 @@ func init() {
15641564
var _ = rac.stateForInit
15651565
var _ = rac.finishInit
15661566
var _ = rac.notEnoughVoters
1567-
var _ = rac.candidatesToConvertFromNonVoterToVoter
1568-
var _ = rac.constraintsForAddingVoter
15691567
var _ = rac.notEnoughNonVoters
1570-
var _ = rac.candidatesToConvertFromVoterToNonVoter
1571-
var _ = rac.constraintsForAddingNonVoter
1572-
var _ = rac.candidatesForRoleSwapForConstraints
1573-
var _ = rac.candidatesToRemove
1574-
var _ = rac.candidatesVoterConstraintsUnsatisfied
1575-
var _ = rac.candidatesNonVoterConstraintsUnsatisfied
15761568
var _ = rac.candidatesToReplaceVoterForRebalance
15771569
var _ = rac.candidatesToReplaceNonVoterForRebalance
15781570

pkg/kv/kvserver/allocator/mmaprototype/constraint_matcher.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,3 @@ func (cm *constraintMatcher) constrainStoresForExpr(expr constraintsDisj, set *s
213213
}
214214
}
215215
}
216-
217-
// Avoid unused lint errors.
218-
219-
var _ = (&constraintMatcher{}).setStore
220-
var _ = (&constraintMatcher{}).removeStore
221-
var _ = (&constraintMatcher{}).checkConsistency

0 commit comments

Comments
 (0)