Skip to content

Expose OccValidationPolicy to the Java API#12547

Open
vjeko wants to merge 1 commit into
facebook:mainfrom
vjeko:optimistic-db-options-jni
Open

Expose OccValidationPolicy to the Java API#12547
vjeko wants to merge 1 commit into
facebook:mainfrom
vjeko:optimistic-db-options-jni

Conversation

@vjeko

@vjeko vjeko commented Apr 16, 2024

Copy link
Copy Markdown

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

@facebook-github-bot

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@adamretter adamretter self-requested a review April 17, 2024 11:38

@adamretter adamretter left a comment

Copy link
Copy Markdown
Collaborator

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?

Comment thread java/rocksjni/optimistic_transaction_db_options.cc Outdated
Comment thread java/rocksjni/portal.h
Comment thread java/rocksjni/portal.h
Comment thread java/src/main/java/org/rocksdb/OccValidationPolicy.java Outdated
Comment thread java/src/main/java/org/rocksdb/OccValidationPolicy.java
Comment thread java/src/main/java/org/rocksdb/OptimisticTransactionDBOptions.java
Comment thread java/src/main/java/org/rocksdb/OptimisticTransactionDBOptions.java
Comment thread java/src/main/java/org/rocksdb/OptimisticTransactionDBOptions.java Outdated
Comment thread java/src/main/java/org/rocksdb/OptimisticTransactionDBOptions.java Outdated
Comment thread java/CMakeLists.txt
@vjeko

vjeko commented Apr 17, 2024

Copy link
Copy Markdown
Author

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 Apr 19, 2024
@vjeko

vjeko commented Apr 19, 2024

Copy link
Copy Markdown
Author

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

vjeko commented Apr 26, 2024

Copy link
Copy Markdown
Author

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

Comment thread java/rocksjni/portal.h
Comment thread java/rocksjni/portal.h
Comment thread java/src/main/java/org/rocksdb/OptimisticTransactionDB.java Outdated
*
* @return The type of OCC Validation Policy used.
*/
OccValidationPolicy getOccValidationPolicy() {

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done.

Comment thread java/src/main/java/org/rocksdb/OptimisticTransactionDBOptions.java Outdated

@adamretter adamretter left a comment

Copy link
Copy Markdown
Collaborator

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

vjeko commented May 7, 2024

Copy link
Copy Markdown
Author

@adamretter Could you take a look again? Thanks!

@vjeko

vjeko commented Jun 17, 2024

Copy link
Copy Markdown
Author

@adamretter Can you let me know if anything else needs to be done for this CL? Thanks!

@adamretter adamretter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@adamretter

Copy link
Copy Markdown
Collaborator

@ajkr @pdillinger Could someone merge this please?

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

3 participants