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

move webhook processing to leader only #369

Merged
merged 3 commits into from
Jan 13, 2015
Merged

Conversation

wsorenson
Copy link
Contributor

  • also move locks into constructor rather than protected, non-final
    access
  • change enabled / abort to use methods

- also move locks into constructor rather than protected, non-final
access
- change enabled / abort to use methods
}

protected SingularityLeaderOnlyPoller(long pollDelay, TimeUnit pollTimeUnit, boolean enabled) {
protected SingularityLeaderOnlyPoller(long pollDelay, TimeUnit pollTimeUnit, Optional<Lock> lockHolder) {
Copy link
Contributor

Choose a reason for hiding this comment

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

That constructor will only ever be called if a lock is present. Make it take the lock directly and have it wrap in an optional here. Also, add a checkNotNull(). :-)

This avoids people to cut'n'paste your code and then replacing the super with super (... , Optional.<Lock>absent())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So in that case I would need a third private constructor which takes the optional?

Maybe it's worth just having a single constructor that takes the optional and making everyone call it.

tpetr added a commit that referenced this pull request Jan 13, 2015
move webhook processing to leader only
@tpetr tpetr merged commit 92d8a60 into master Jan 13, 2015
@ssalinas ssalinas deleted the move_webhook_to_leader branch May 4, 2015 20:03
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.

3 participants