diff --git a/include/rocksdb/env.h b/include/rocksdb/env.h index 7bdb6ee61..28bffe735 100644 --- a/include/rocksdb/env.h +++ b/include/rocksdb/env.h @@ -561,7 +561,7 @@ class WritableFile { * underlying storage of a file (generally via fallocate) if the Env * instance supports it. */ - void SetPreallocationBlockSize(size_t size) { + virtual void SetPreallocationBlockSize(size_t size) { preallocation_block_size_ = size; } @@ -597,7 +597,7 @@ class WritableFile { // of space on devices where it can result in less file // fragmentation and/or less waste from over-zealous filesystem // pre-allocation. - void PrepareWrite(size_t offset, size_t len) { + virtual void PrepareWrite(size_t offset, size_t len) { if (preallocation_block_size_ == 0) { return; } @@ -950,6 +950,13 @@ class WritableFileWrapper : public WritableFile { return target_->InvalidateCache(offset, length); } + virtual void SetPreallocationBlockSize(size_t size) override { + target_->SetPreallocationBlockSize(size); + } + virtual void PrepareWrite(size_t offset, size_t len) override { + target_->PrepareWrite(offset, len); + } + protected: Status Allocate(uint64_t offset, uint64_t len) override { return target_->Allocate(offset, len);