Skip to content

Commit

Permalink
feat: export searcher evaluate func (#842)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi committed Nov 30, 2021
1 parent de30f0a commit c8af201
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manager/searcher/searcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (s *searcher) FindSchedulerCluster(ctx context.Context, schedulerClusters [
continue
}

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

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

0 comments on commit c8af201

Please sign in to comment.