Improve the C APIs for batch receive policy and fix the wrong documents - #256
Merged
shibd merged 1 commit intoApr 21, 2023
Merged
Conversation
### Motivation Currently, the `pulsar_consumer_configuration_get_batch_receive_policy` function returns a struct whose size is greater than 8, which is generally not acceptable in C API design because of the copy overhead. And the API documents are wrong that they say if the value is less than 0, it means no limit. However, if the value is exactly 0, it also means no limit. ### Modifications Use the POSIX style for these C APIs. The setter returns -1 if it failed. The getter accepts an output argument to store the value to get. Then test these changes in `testCApiConfig`. The docs are also fixed.
shibd
reviewed
Apr 20, 2023
shibd
previously approved these changes
Apr 20, 2023
shibd
self-requested a review
April 20, 2023 14:20
Contributor
Author
|
It's weird there is no helpful error prompt. I reran the CI first. |
Contributor
Author
|
I reverted this PR and could still reproduce the build failure in my local env. It seems related to compiling with 8 threads. Maybe we need some further improvements for the build process. |
shibd
approved these changes
Apr 21, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Currently, the
pulsar_consumer_configuration_get_batch_receive_policyfunction returns a struct whose size is greater than 8, which is generally not acceptable in C API design because of the copy overhead.And the API documents are wrong that they say if the value is less than 0, it means no limit. However, if the value is exactly 0, it also means no limit.
Modifications
Use the POSIX style for these C APIs. The setter returns -1 if it failed. The getter accepts an output argument to store the value to get.
Then test these changes in
testCApiConfig. The docs are also fixed.Documentation
doc-required(Your PR needs to update docs and you will update later)
doc-not-needed(Please explain why)
doc(Your PR contains doc changes)
doc-complete(Docs have been already added)