rocksdb/java
Alan Paxton 93e0715fad Implement missing compactrangeoptions from Java API (#10880)
Summary:
Add the following missing options to `src/main/java/org/rocksdb/CompactRangeOptions.java` and in `java/rocksjni/options.cc` in RocksJava.

For the descriptions and API see the C++ file `include/rocksdb/options.h`, specifically the struct `CompactRangeOptions`

* full_history_ts_low
* canceled

We changed the handle to return an object (of class `Java_org_rocksdb_CompactRangeOptions`) containing a `ROCKSDB_NAMESPACE::CompactRangeOptions` at (almost certainly) 0-offset, rather than a raw `ROCKSDB_NAMESPACE::CompactRangeOptions`.

The `Java_org_rocksdb_CompactRangeOptions` contains as supplementary fields objects (std::string, std::atomic<bool>) which are passed as pointers to the `ROCKSDB_NAMESPACE::CompactRangeOptions` and which must therefore live for as long as the `ROCKSDB_NAMESPACE::CompactRangeOptions`. By placing them in a `Java_org_rocksdb_CompactRangeOptions` we achieve this.

Because the field offset of the `ROCKSDB_NAMESPACE::CompactRangeOptions` member is (very probably) 0, casting the handle to ROCKSDB_NAMESPACE::CompactRangeOptions works (i.e. old methods didn’t have to be changed), but really that’s a minefield and the correct answer is to cast to the correct type (Java_org_rocksdb_CompactRangeOptions) and then use the ROCKSDB_NAMESPACE::CompactRangeOptions field in that. So the get/set methods for existing parameters have this change.

Testing
-------
We added unit tests for getting and setting the newly implemented fields to `CompactRangeOptionsTest`

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10880

Reviewed By: ajkr

Differential Revision: D41482476

Pulled By: anand1976

fbshipit-source-id: c70795e790436fb3544655920adf6fca62ed34e2
2023-05-24 11:04:46 -07:00
..
benchmark/src/main/java/org/rocksdb/benchmark jni: expose memtable_whole_key_filtering option (#9394) 2022-02-04 16:01:16 -08:00
crossbuild Support C++17 Docker build environments for RocksJava (#9500) 2022-02-17 12:48:38 -08:00
jmh Improve Java API get() performance by reducing copies (#10970) 2022-12-21 11:54:24 -08:00
rocksjni Implement missing compactrangeoptions from Java API (#10880) 2023-05-24 11:04:46 -07:00
samples/src/main/java Remove compressed block cache (#11117) 2023-01-24 17:09:19 -08:00
src Implement missing compactrangeoptions from Java API (#10880) 2023-05-24 11:04:46 -07:00
CMakeLists.txt Set -source 8 in CMAKE_JAVA_COMPILE_FLAGS (#11385) 2023-04-18 11:15:25 -07:00
GetBenchmarks.md Improve Java API get() performance by reducing copies (#10970) 2022-12-21 11:54:24 -08:00
HISTORY-JAVA.md Update JAVA-HISTORY.md for v3.13 2015-08-04 18:12:58 -07:00
Makefile Fix Java API ComparatorOptions use after delete error (#11176) 2023-02-17 13:03:41 -08:00
RELEASE.md Add shared library for musl-libc (#3143) 2019-11-26 18:24:09 -08:00
jdb_bench.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
pom.xml.template Improve Java API get() performance by reducing copies (#10970) 2022-12-21 11:54:24 -08:00
understanding_options.md New-style blob option bindings, Java option getter and improve/fix option parsing (#8999) 2021-10-19 09:21:52 -07:00