-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move MigrateCost to MoveCost #1585
move MigrateCost to MoveCost #1585
Conversation
@qoo332001 好像連 build 都不會過,可以看一下嗎 |
…ctorMigrateCostToMoveCosts
已更新,麻煩再看一下 |
@qoo332001 可否試著說明一下為何選擇這個作法? |
實做時主要是考慮兩個作法:
直覺上當使用者在自行新增(實做) |
@qoo332001 感謝回覆,不過我還想了解一下 當然上述擔憂也可能算是 overkill,所以我想聽聽你預期的使用場景 |
現在的用法就只是最後在搬移計畫確定後,會想要讓使用者知道搬移成本,當初會想要放到介面主要是怕未來會有調用成本的需求,所以才包成 |
我說的成本是指“演算法本來可以 return early 的地方,會因為要產生一個“完整”的報告,導致必須全部算完 例如 #1584 中要去限制最大的移動量,當叢集很大的時候,我們可以做一個優化叫做“統計到超過限制時就提早回傳 overflow“,如此剩下的 partitions 就可以不用統計了,因為已經 overflow 了,但是如果現在在介面上加上說要傳回“統計報告”,這樣就會讓實作一定要“看完”所有的 partitions |
…ctorMigrateCostToMoveCosts
…ctorMigrateCostToMoveCosts
…ctorMigrateCostToMoveCosts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qoo332001 感謝更新
現在有許多 helpers 要稍微思考和慎選一下要放的位置,才不會讓程式碼之間互相依賴的狀況變複雜
common/src/main/java/org/astraea/common/cost/RecordSizeCost.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/astraea/common/cost/MigrationCost.java
Outdated
Show resolved
Hide resolved
…ctorMigrateCostToMoveCosts
common/src/main/java/org/astraea/common/cost/MigrationCost.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qoo332001 基本沒什麼問題了,一個小建議調整後就可以合併了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
comment 將MigrationCost移動到
CostFunction
,如此一來Balancer就不需知道當前有哪些成本要計算,以及列舉這些成本