mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-30 13:41:46 +00:00
93e0715fad
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 |
||
---|---|---|
.. | ||
benchmark/src/main/java/org/rocksdb/benchmark | ||
crossbuild | ||
jmh | ||
rocksjni | ||
samples/src/main/java | ||
src | ||
CMakeLists.txt | ||
GetBenchmarks.md | ||
HISTORY-JAVA.md | ||
jdb_bench.sh | ||
Makefile | ||
pom.xml.template | ||
RELEASE.md | ||
understanding_options.md |