rocksdb icon indicating copy to clipboard operation
rocksdb copied to clipboard

Java Load correct filter policy into table options

Open alanpaxton opened this issue 11 months ago • 1 comments

OptionsUtilTest was using a broken assertThat, and a check of the loaded filter policy was not happening. Correcting the test exposed that the filter policy was not being correctly loaded into the Java side BlockBasedTableOptions/BlockBasedTableConfig.

Fix this by constructing the Java Filter (should be renamed FilterPolicy for consistency, but that is too hard) from C++ in the same way as any other Java object via JNI, and installing it in the BlockBasedTableConfig. Subtlety 1 is that the handle for a FilterPolicy is a std::shared_ptr<FilterPolicy> so we need to allocate a new one which shares control block with the shared_ptr stored in corresponding C++ BlockBasedTableOptions

Extend the work to fix a specific issue: Fixes https://github.com/facebook/rocksdb/issues/13519 Load block based table options into ColumnFamilyOptions so that ColumnFamilyOptions.getDescriptor().getOptions().tableFormatConfig() returns a configuration instead of null.

alanpaxton avatar Jan 27 '25 17:01 alanpaxton

Just one comment(maybe opinion).

Otherwise LGTM ✅

rhubner avatar Jan 29 '25 10:01 rhubner