Skip to content

Commit c8af201

Browse files
authored
feat: export searcher evaluate func (#842)
Signed-off-by: Gaius <[email protected]>
1 parent de30f0a commit c8af201

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

manager/searcher/searcher.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func (s *searcher) FindSchedulerCluster(ctx context.Context, schedulerClusters [
135135
continue
136136
}
137137

138-
score := evaluate(conditions, scopes)
138+
score := Evaluate(conditions, scopes)
139139
if score > maxScore {
140140
maxScore = score
141141
result = cluster
@@ -146,7 +146,7 @@ func (s *searcher) FindSchedulerCluster(ctx context.Context, schedulerClusters [
146146
}
147147

148148
// Evaluate the degree of matching between scheduler cluster and dfdaemon
149-
func evaluate(conditions map[string]string, scopes Scopes) float64 {
149+
func Evaluate(conditions map[string]string, scopes Scopes) float64 {
150150
return idcAffinityWeight*calculateIDCAffinityScore(conditions[ConditionIDC], scopes.IDC) +
151151
locationAffinityWeight*calculateMultiElementAffinityScore(conditions[ConditionLocation], scopes.Location) +
152152
netTopologyAffinityWeight*calculateMultiElementAffinityScore(conditions[ConditionNetTopology], scopes.NetTopology)

0 commit comments

Comments
 (0)