diff --git a/db/c.cc b/db/c.cc index d5ac613b4..9615791a8 100644 --- a/db/c.cc +++ b/db/c.cc @@ -4449,6 +4449,15 @@ rocksdb_readoptions_get_io_timeout(rocksdb_readoptions_t* opt) { return opt->rep.io_timeout.count(); } +void rocksdb_readoptions_set_async_io(rocksdb_readoptions_t* opt, + unsigned char v) { + opt->rep.async_io = v; +} + +unsigned char rocksdb_readoptions_get_async_io(rocksdb_readoptions_t* opt) { + return opt->rep.async_io; +} + void rocksdb_readoptions_set_timestamp(rocksdb_readoptions_t* opt, const char* ts, size_t tslen) { if (ts == nullptr) { diff --git a/db/c_test.c b/db/c_test.c index 249ab9023..b6877d46a 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -2572,6 +2572,9 @@ int main(int argc, char** argv) { rocksdb_readoptions_set_io_timeout(ro, 400); CheckCondition(400 == rocksdb_readoptions_get_io_timeout(ro)); + rocksdb_readoptions_set_async_io(ro, 1); + CheckCondition(1 == rocksdb_readoptions_get_async_io(ro)); + rocksdb_readoptions_destroy(ro); } diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 5f3e586f2..11e4d2686 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -1894,6 +1894,10 @@ extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_io_timeout( rocksdb_readoptions_t*, uint64_t microseconds); extern ROCKSDB_LIBRARY_API uint64_t rocksdb_readoptions_get_io_timeout(rocksdb_readoptions_t*); +extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_async_io( + rocksdb_readoptions_t*, unsigned char); +extern ROCKSDB_LIBRARY_API unsigned char rocksdb_readoptions_get_async_io( + rocksdb_readoptions_t*); extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_timestamp( rocksdb_readoptions_t*, const char* ts, size_t tslen); extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_iter_start_ts(