Actually enable io-uring (#751)

master
Niklas Fiekas 2 years ago committed by GitHub
parent 9e519fe6e4
commit ef8d60ae00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      librocksdb-sys/build_version.cc
  2. 11
      src/db_options.rs

@ -23,6 +23,10 @@ static const std::string rocksdb_build_date = "rocksdb_build_date:2023-02-19 21:
std::unordered_map<std::string, ROCKSDB_NAMESPACE::RegistrarFunc> ROCKSDB_NAMESPACE::ObjectRegistry::builtins_ = {}; std::unordered_map<std::string, ROCKSDB_NAMESPACE::RegistrarFunc> ROCKSDB_NAMESPACE::ObjectRegistry::builtins_ = {};
extern "C" bool RocksDbIOUringEnable() {
return true;
}
namespace ROCKSDB_NAMESPACE { namespace ROCKSDB_NAMESPACE {
static void AddProperty(std::unordered_map<std::string, std::string> *props, const std::string& name) { static void AddProperty(std::unordered_map<std::string, std::string> *props, const std::string& name) {
size_t colon = name.find(":"); size_t colon = name.find(":");

@ -3417,6 +3417,17 @@ impl ReadOptions {
ffi::rocksdb_readoptions_set_pin_data(self.inner, c_uchar::from(v)); ffi::rocksdb_readoptions_set_pin_data(self.inner, c_uchar::from(v));
} }
} }
/// Asynchronously prefetch some data.
///
/// Used for sequential reads and internal automatic prefetching.
///
/// Default: `false`
pub fn set_async_io(&mut self, v: bool) {
unsafe {
ffi::rocksdb_readoptions_set_async_io(self.inner, c_uchar::from(v));
}
}
} }
impl Default for ReadOptions { impl Default for ReadOptions {

Loading…
Cancel
Save