Skip to content
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

improve fill & each strategy #315

Merged
merged 3 commits into from
Jan 15, 2021
Merged

Conversation

jschwinger233
Copy link
Member

  1. cap-based priority
  2. make clear limit semantic
  3. delete resourceType in xxxPlan arguments

@jschwinger233 jschwinger233 force-pushed the zc/strategy branch 2 times, most recently from 2a91eea to e57f864 Compare January 14, 2021 11:28
scheduleInfosLength := len(infos)
if limit == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥 avg 我记得没这个判断

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里还有一点问题, limit = 0 之前的语义是:

  1. avg: 注释里写的是“容量够的尽量填, 不够就算了”,
  2. fill: 注释里没解释, 但是从处理细节来看, limit=0 就是不做第二轮筛选(第一轮是把已满足 count > need 的筛掉), 所以也可以理解为 “尽量填”

然而由于 avg / fill 都是一进去就 if scheduleInfosLength < limit { return err } , 所以其实之前是没有实现注释里的语义的...

然后我觉得“尽量填”这个需求似乎没有“全部填”常用?
因为“尽量填”可能导致编排下来的结果是所有节点 cap 都不够, 所以一个都不填了, 似乎用户不会有这种期望..
所以我改成了 “全部填” 的语义了...

然后实现上还有一点小问题, 我再改改, 加两个测试..

@jschwinger233 jschwinger233 force-pushed the zc/strategy branch 2 times, most recently from da86ea1 to b8e718e Compare January 15, 2021 06:24
@jschwinger233 jschwinger233 changed the title [WIP] improve fill & each improve fill & each strategy Jan 15, 2021
@CMGS CMGS merged commit c69ed71 into projecteru2:master Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants