-
Notifications
You must be signed in to change notification settings - Fork 726
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
*: adjust scheduler interface #798
Conversation
server/schedule/scheduler.go
Outdated
GetResourceKind() core.ResourceKind | ||
GetResourceLimit() uint64 | ||
Prepare(cluster Cluster) error | ||
Cleanup(cluster Cluster) | ||
Schedule(cluster Cluster) *Operator | ||
IsAllowSchedule() bool |
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.
I suppose we can remove GetResourceKind()
, GetResourceLimit()
, IsAllowSchedule()
from interface, Schedulers can check limit by themselves.
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.
the controller should know IsAllowSchedule
. Directly return nil operator will change tick time.
server/schedule/scheduler.go
Outdated
func (l *Limiter) RemoveOperator(op *Operator) { | ||
l.Lock() | ||
defer l.Unlock() | ||
l.counts[op.ResourceKind()]-- |
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.
need consider overflow here?
LGTM. |
server/schedule/scheduler.go
Outdated
Prepare(cluster Cluster) error | ||
Cleanup(cluster Cluster) | ||
Schedule(cluster Cluster) *Operator | ||
IsAllowSchedule() bool |
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.
IsScheduleAllowd
LGTM. |
We are going to merge it after GA. |
/run-all-tests |
this PR do: