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

*: adjust scheduler interface #798

Merged
merged 9 commits into from
Oct 16, 2017
Merged

*: adjust scheduler interface #798

merged 9 commits into from
Oct 16, 2017

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Oct 14, 2017

this PR do:

  • let the scheduler control schedule interval by itself
  • let the scheduler know limiter and decide it can be scheduled. our scheduler may product two type operator, leader or peer, the controller does not distinguish them.

GetResourceKind() core.ResourceKind
GetResourceLimit() uint64
Prepare(cluster Cluster) error
Cleanup(cluster Cluster)
Schedule(cluster Cluster) *Operator
IsAllowSchedule() bool
Copy link
Contributor

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.

Copy link
Contributor Author

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.

func (l *Limiter) RemoveOperator(op *Operator) {
l.Lock()
defer l.Unlock()
l.counts[op.ResourceKind()]--
Copy link
Contributor

@siddontang siddontang Oct 14, 2017

Choose a reason for hiding this comment

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

need consider overflow here?

@disksing
Copy link
Contributor

LGTM.

Prepare(cluster Cluster) error
Cleanup(cluster Cluster)
Schedule(cluster Cluster) *Operator
IsAllowSchedule() bool
Copy link
Contributor

Choose a reason for hiding this comment

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

IsScheduleAllowd

@Connor1996
Copy link
Member

LGTM.

@disksing
Copy link
Contributor

We are going to merge it after GA.

@disksing
Copy link
Contributor

/run-all-tests

@disksing disksing merged commit e10b9a2 into master Oct 16, 2017
@disksing disksing deleted the shuning/adjust-scheduler branch October 16, 2017 06:23
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.

4 participants