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

Clean up aggregator via helper methods #511

Merged
merged 1 commit into from
Aug 13, 2015
Merged

Conversation

eapache
Copy link
Contributor

@eapache eapache commented Aug 13, 2015

Also get rid of forceFlushThreshold it does not need its own function

@wvanbergen

Also get rid of forceFlushThreshold it does not need its own function
func (a *aggregator) wouldOverflow(msg *ProducerMessage) bool {
switch {
// Would we overflow our maximum possible size-on-the-wire? 10KiB is arbitrary overhead for safety.
case a.bufferBytes+msg.byteSize() >= int(MaxRequestSize-(10*1024)):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we trust the compiler to optimize the static calculation into a constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We weren't before and nobody ever complained...

@wvanbergen
Copy link
Contributor

👍 this one is pretty straightforward

eapache added a commit that referenced this pull request Aug 13, 2015
Clean up aggregator via helper methods
@eapache eapache merged commit 6f82d15 into master Aug 13, 2015
@eapache eapache deleted the cleanup-aggregator branch August 13, 2015 19:13
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