* Added new callback APIs `OnBlobFileCreationStarted`,`OnBlobFileCreated`and `OnBlobFileDeleted` in `EventListener` class of listener.h. It notifies listeners during creation/deletion of individual blob files in Integrated BlobDB. It also log blob file creation finished event and deletion event in LOG file.
* Batch blob read requests for `DB::MultiGet` using `MultiRead`.
* Add support for fallback to local compaction, the user can return `CompactionServiceJobStatus::kUseLocal` to instruct RocksDB to run the compaction locally instead of waiting for the remote compaction result.
+* Add built-in rate limiter's implementation for `RateLimiter::GetTotalPendingRequests()` for the total number of requests that are pending for bytes in the rate limiter.
### Public API change
* Remove obsolete implementation details FullKey and ParseFullKey from public API
-* Add a public API RateLimiter::GetTotalPendingRequests() for the total number of requests that are pending for bytes in the rate limiter.
* Change `SstFileMetaData::size` from `size_t` to `uint64_t`.
* Made Statistics extend the Customizable class and added a CreateFromString method. Implementations of Statistics need to be registered with the ObjectRegistry and to implement a Name() method in order to be created via this method.
* Extended `FlushJobInfo` and `CompactionJobInfo` in listener.h to provide information about the blob files generated by a flush/compaction and garbage collected during compaction in Integrated BlobDB. Added struct members `blob_file_addition_infos` and `blob_file_garbage_infos` that contain this information.
ASSERT_LT(ratio, 0.6);
}
+// This is a mocked customed rate limiter without implementing optional APIs
+// (e.g, RateLimiter::GetTotalPendingRequests())
+class MockedRateLimiterWithNoOptionalAPIImpl : public RateLimiter {
+ public:
+ MockedRateLimiterWithNoOptionalAPIImpl() {}
+
+ ~MockedRateLimiterWithNoOptionalAPIImpl() override {}
+
+ void SetBytesPerSecond(int64_t bytes_per_second) override {
+ (void)bytes_per_second;
+ }
+
+ using RateLimiter::Request;
+ void Request(const int64_t bytes, const Env::IOPriority pri,
+ Statistics* stats) override {
+ (void)bytes;
+ (void)pri;
+ (void)stats;
+ }
+
+ int64_t GetSingleBurstBytes() const override { return 200; }
+
+ int64_t GetTotalBytesThrough(
+ const Env::IOPriority pri = Env::IO_TOTAL) const override {
+ (void)pri;
+ return 0;
+ }
+
+ int64_t GetTotalRequests(
+ const Env::IOPriority pri = Env::IO_TOTAL) const override {
+ (void)pri;
+ return 0;
+ }
+
+ int64_t GetBytesPerSecond() const override { return 0; }
+};
+
+// To test that customed rate limiter not implementing optional APIs (e.g,
+// RateLimiter::GetTotalPendingRequests()) works fine with RocksDB basic
+// operations (e.g, Put, Get, Flush)
+TEST_F(DBTest, CustomedRateLimiterWithNoOptionalAPIImplTest) {
+ Options options = CurrentOptions();
+ options.rate_limiter.reset(new MockedRateLimiterWithNoOptionalAPIImpl());
+ DestroyAndReopen(options);
+ ASSERT_OK(Put("abc", "def"));
+ ASSERT_EQ(Get("abc"), "def");
+ ASSERT_OK(Flush());
+ ASSERT_EQ(Get("abc"), "def");
+}
+
TEST_F(DBTest, TableOptionsSanitizeTest) {
Options options = CurrentOptions();
options.create_if_missing = true;
const Env::IOPriority pri = Env::IO_TOTAL) const = 0;
// Total # of requests that are pending for bytes in rate limiter
+ // For convenience, this function is implemented by the RateLimiter returned
+ // by NewGenericRateLimiter but is not required by RocksDB. The default
+ // implementation indicates "not supported".
virtual int64_t GetTotalPendingRequests(
- const Env::IOPriority pri = Env::IO_TOTAL) const = 0;
+ const Env::IOPriority pri = Env::IO_TOTAL) const {
+ assert(false);
+ (void)pri;
+ return -1;
+ }
virtual int64_t GetBytesPerSecond() const = 0;