Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adamretter
Copy link
Contributor

@adamretter adamretter commented Jan 6, 2018

This is an abstraction for working with custom Comparators implemented in native C++ code from Java. Native code must directly extend rocksdb::Comparator. When the native code comparator is compiled into the RocksDB codebase, you can then create a Java Class, and JNI stub to wrap it.

Useful if the C++/JNI barrier overhead is too much for your applications comparator performance.

An example is provided in java/rocksjni/native_comparator_wrapper_test.cc and java/src/main/java/org/rocksdb/NativeComparatorWrapperTest.java.

@facebook-github-bot
Copy link
Contributor

@adamretter has updated the pull request.

@adamretter adamretter force-pushed the java-wrapper-native-comparator branch from a141862 to 4b6e9e7 Compare January 25, 2018 17:33
@facebook-github-bot
Copy link
Contributor

@adamretter has updated the pull request.

@siying siying requested a review from sagar0 January 31, 2018 20:20
Copy link
Contributor

@benclay benclay 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 to me FWIW.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: It'd be nice to have a native enum and reinterpret_cast jcomparator_type into it instead of using byte values directly each time, here and elsewhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Could you add a short 1-line comment for each of these? I was jumping back to the corresponding *Comparator.java class javadocs initially, a brief description would help the reader.

@adamretter adamretter force-pushed the java-wrapper-native-comparator branch from 4b6e9e7 to e4f9c45 Compare March 1, 2018 13:21
@facebook-github-bot
Copy link
Contributor

@adamretter has updated the pull request.

@adamretter adamretter force-pushed the java-wrapper-native-comparator branch from e4f9c45 to 1648a09 Compare March 3, 2018 09:55
@facebook-github-bot
Copy link
Contributor

@adamretter has updated the pull request.

@adamretter adamretter force-pushed the java-wrapper-native-comparator branch from 1648a09 to a93eda8 Compare March 6, 2018 15:05
@facebook-github-bot
Copy link
Contributor

@adamretter has updated the pull request.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@miasantreble has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@adamretter adamretter force-pushed the java-wrapper-native-comparator branch from a93eda8 to 62adec9 Compare March 7, 2018 08:52
@facebook-github-bot
Copy link
Contributor

@adamretter has updated the pull request.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@miasantreble is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

miasantreble pushed a commit that referenced this pull request Mar 8, 2018
Summary:
This is an abstraction for working with custom Comparators implemented in native C++ code from Java. Native code must directly extend `rocksdb::Comparator`. When the native code comparator is compiled into the RocksDB codebase, you can then create a Java Class, and JNI stub to wrap it.

Useful if the C++/JNI barrier overhead is too much for your applications comparator performance.

An example is provided in `java/rocksjni/native_comparator_wrapper_test.cc` and `java/src/main/java/org/rocksdb/NativeComparatorWrapperTest.java`.
Closes #3334

Differential Revision: D7172605

Pulled By: miasantreble

fbshipit-source-id: e24b7eb267a3bcb6afa214e0379a1d5e8a2ceabe
sagar0 pushed a commit that referenced this pull request Mar 15, 2018
Summary:
This is an abstraction for working with custom Comparators implemented in native C++ code from Java. Native code must directly extend `rocksdb::Comparator`. When the native code comparator is compiled into the RocksDB codebase, you can then create a Java Class, and JNI stub to wrap it.

Useful if the C++/JNI barrier overhead is too much for your applications comparator performance.

An example is provided in `java/rocksjni/native_comparator_wrapper_test.cc` and `java/src/main/java/org/rocksdb/NativeComparatorWrapperTest.java`.
Closes #3334

Differential Revision: D7172605

Pulled By: miasantreble

fbshipit-source-id: e24b7eb267a3bcb6afa214e0379a1d5e8a2ceabe
@guozhangwang
Copy link

Hello @adamretter do you know which release version will include this interface?

@adamretter
Copy link
Contributor Author

@sagar0 @fosco can you comment?

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.

5 participants