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

KAFKA-4011 - fix issues and beef up tests around ByteBoundedBlockingQueue #1714

Conversation

radai-rosenblatt
Copy link
Contributor

as discussed under KIP-72

extends Iterable[E] {
if (sizeFunction == null || sizeFunction.isEmpty) {
throw new IllegalArgumentException("size function must be provided")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to make it mandatory, then we should just change sizeFunction to be E => Long. Option only makes sense if we want it to be optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, fixed (and force pushed)

currentByteSize.addAndGet(sizeFunction.get(e))
if (currentByteSize.get() < queueByteCapacity && leftToWait > 0) {
val success = queue.offer(e, leftToWait, TimeUnit.NANOSECONDS) //wait to clear numElements req.
val sizeBytesAfter = if (success) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: In Kafka we don't put brackets for one line code.

@ewencp
Copy link
Contributor

ewencp commented Nov 14, 2016

@becketqin Are you happy with this now or should someone else take a pass at review?

@becketqin
Copy link
Contributor

@ewencp This PR is actually for KIP-72, which has been changed quite a bit since its initial proposal. So this PR seems not applicable any more. @radai-rosenblatt Could you close the PR and link the KIP to the right PR?

@radai-rosenblatt
Copy link
Contributor Author

this patch contains fixes to ByteBoundedBlockingQueue. KIP-72 no longer intends to use this class and, given nothing else uses it either, it should probably be deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants