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

Expose OccValidationPolicy to the Java API #12547

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vjeko
Copy link

@vjeko vjeko commented Apr 16, 2024

Allow users of RocksDB JNI to specify the OCC Validation Policy when using OptimisticTransactionOptionsDB.

@facebook-github-bot
Copy link
Contributor

Hi @vjeko!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@vjeko vjeko force-pushed the optimistic-db-options-jni branch from d08cbc5 to c082d35 Compare April 16, 2024 16:57
@vjeko vjeko marked this pull request as draft April 16, 2024 17:12
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Copy link
Collaborator

@adamretter adamretter left a comment

Choose a reason for hiding this comment

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

Looks good in general. Some small things need changing. We also need JUnit tests to accompany the code please?

java/rocksjni/optimistic_transaction_db_options.cc Outdated Show resolved Hide resolved
java/rocksjni/portal.h Show resolved Hide resolved
java/rocksjni/portal.h Show resolved Hide resolved
java/src/main/java/org/rocksdb/OccValidationPolicy.java Outdated Show resolved Hide resolved
java/CMakeLists.txt Show resolved Hide resolved
@vjeko
Copy link
Author

vjeko commented Apr 17, 2024

Looks good in general. Some small things need changing. We also need JUnit tests to accompany the code please?

Thanks for taking a look! Yes, that was the plan. I'll ping you once the CL is considered finished.

Thanks again!

@vjeko vjeko force-pushed the optimistic-db-options-jni branch 9 times, most recently from 6e018a8 to 6c20910 Compare April 19, 2024 19:16
@vjeko vjeko marked this pull request as ready for review April 19, 2024 19:21
@vjeko vjeko force-pushed the optimistic-db-options-jni branch from 6c20910 to 907ba38 Compare April 19, 2024 19:39
@vjeko vjeko changed the title Export OccValidationPolicy to JNI Expose OccValidationPolicy to the Java API Apr 19, 2024
@vjeko
Copy link
Author

vjeko commented Apr 19, 2024

Hi @adamretter -- the CL is ready for review. Would you mind taking another look? Thanks!

@vjeko vjeko requested a review from adamretter April 19, 2024 19:56
@vjeko
Copy link
Author

vjeko commented Apr 26, 2024

@adamretter Just checking to see if you have time to review this CL? Thanks!

switch (policy) {
case 0x0:
return ROCKSDB_NAMESPACE::OccValidationPolicy::kValidateSerial;
default:
Copy link
Collaborator

Choose a reason for hiding this comment

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

See comment above on fall-through

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

*
* @return The type of OCC Validation Policy used.
*/
OccValidationPolicy getOccValidationPolicy() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Function scope should be "public" and not "package-private"

Copy link
Collaborator

Choose a reason for hiding this comment

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

Getters in RocksJava are typically not prefixed get - see other classes for the naming convention.

Copy link
Author

Choose a reason for hiding this comment

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

Done.

Copy link
Collaborator

@adamretter adamretter left a comment

Choose a reason for hiding this comment

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

Looking much better - just a couple of small fixes needed.

Allow users of RocksDB JNI to specify the OCC Validation Policy
when using OptimisticTransactionOptionsDB.
@vjeko vjeko force-pushed the optimistic-db-options-jni branch from 907ba38 to 15fff9e Compare April 29, 2024 22:56
@vjeko vjeko requested a review from adamretter April 29, 2024 23:26
@vjeko
Copy link
Author

vjeko commented May 7, 2024

@adamretter Could you take a look again? Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants