From 9cd47ce554d7ef92e01f11566ae24312335aa824 Mon Sep 17 00:00:00 2001 From: Hui Xiao Date: Tue, 5 Apr 2022 08:46:48 -0700 Subject: [PATCH] Add Env::IOPriority to IOOptions (#9806) Summary: **Context/Todo:** As requested, allow IOOptions to take in an Env::IOPriority for convenience to pass down rate limiter related hint to file system level and for future interaction between RocksDB internal's rate limiting and custom file system level's rate-limiting. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9806 Test Plan: No actual code changes in RocksDB internals Reviewed By: ajkr Differential Revision: D35388966 Pulled By: hx235 fbshipit-source-id: 5891c97c3f9184cd221a9ab8536ce8dfa8526c08 --- include/rocksdb/file_system.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/rocksdb/file_system.h b/include/rocksdb/file_system.h index 1dec4cf85..c856f6c65 100644 --- a/include/rocksdb/file_system.h +++ b/include/rocksdb/file_system.h @@ -89,6 +89,12 @@ struct IOOptions { // Priority - high or low IOPriority prio; + // Priority used to charge rate limiter configured in file system level (if + // any) + // Limitation: right now RocksDB internal does not consider this + // rate_limiter_priority + Env::IOPriority rate_limiter_priority; + // Type of data being read/written IOType type; @@ -109,6 +115,7 @@ struct IOOptions { explicit IOOptions(bool force_dir_fsync_) : timeout(std::chrono::microseconds::zero()), prio(IOPriority::kIOLow), + rate_limiter_priority(Env::IO_TOTAL), type(IOType::kUnknown), force_dir_fsync(force_dir_fsync_) {} };