-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Support flush reasons above 12 in Java integration #13246
base: main
Are you sure you want to change the base?
Conversation
Here is what can be seen on the console (probably, it's stderr) during flushes:
|
Hi @rpuch - that looks good. How hard would it be to add a unit test which will fail again if another value is added to the enum in future ? I'm sure you are aware that you will need to rebase before the RocksDB Core Team will look at merging your change. |
Hi Alan, thanks for your review. I will try to add such a test, but right now I'm not even sure how to start. Should the test be in Java? If yes, what is the recommended way to obtain max FlushReason value defined in C++? If not in Java, do you have other suggestions? As for rebasing: sure, I'll do it. But does this rule mean that after any commit gets merged to |
Hi @rpuch - I'm not sure if a unit test needs to know the maximum. Just something that calls fromValue() in the way your code does, will fail when it finally sees a new, larger value ? Let's leave the rebase until we are happy with your PR, then do it once, and you will probably be asked to do it once more by the RocksDB Core Team when they are ready to pull it into their system. |
The thing is that it's not my code that calls This is the problem I'm trying to fix. I could write a unit test making sure that |
Ah sorry, I misunderstood. Then perhaps the best thing is simply to add a comment to the C++ enum, indicating that any new values should be added to Java also. |
Summary: FlushReason enum in C++ has members up to 15, but in Java, the mirroring FlushReason only supports reason codes up to 12. This causes exceptions when adding a flush listener.
5f100c7
to
615e0ff
Compare
Thanks @rpuch that all looks good to me. @jaykorean could you or someone else on the team import this one ? |
@jaykorean has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary:
FlushReason enum in C++ has members up to 15, but in Java, the mirroring FlushReason only supports reason codes up to 12. This causes exceptions when adding a flush listener.