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

[FLINK-5002] Renamed getNumberOfUsedBuffers() method to bestEffortGetNumOfUsedBuffers(), add a check to ensure that it does not return a negative value #2865

Closed
wants to merge 2 commits into from

Conversation

MayerRoman
Copy link
Contributor

[FLINK-5002] Lack of synchronization in LocalBufferPool#getNumberOfUsedBuffers

According to Stefan proposal, I renamed the method and added test to make sure that the method does not return a negative value.

…NumOfUsedBuffers(), add a test to check that it does not return a negative value.
@StephanEwen
Copy link
Contributor

Looks good. The test is almost a bit overkill, I think.
A adding a simple Math.max(0, value) to ensure the value is non-negative probably does the trick.

…). Added check in bestEffortGetNumOfUsedBuffers(), to ensure that a return value is non-negative
@MayerRoman MayerRoman changed the title [FLINK-5002] Renamed getNumberOfUsedBuffers() method to bestEffortGetNumOfUsedBuffers(), add a test to check that it does not return a negative value [FLINK-5002] Renamed getNumberOfUsedBuffers() method to bestEffortGetNumOfUsedBuffers(), add a check to ensure that it does not return a negative value Dec 7, 2016
@MayerRoman
Copy link
Contributor Author

Please check changes.
I removed the test and add a check in method.

@StephanEwen
Copy link
Contributor

Thanks, looks good.
Merging this...

@asfgit asfgit closed this in a5cf88f Dec 14, 2016
joseprupi pushed a commit to joseprupi/flink that referenced this pull request Feb 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants