Skip to content

Commit

Permalink
test: WritableFile derived class: add missing GetFileSize() override
Browse files Browse the repository at this point in the history
  • Loading branch information
rockeet committed Aug 21, 2023
1 parent f53018c commit ff4a5ee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions db/db_test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ class SpecialEnv : public EnvWrapper {
size_t GetUniqueId(char* id, size_t max_size) const override {
return base_->GetUniqueId(id, max_size);
}
uint64_t GetFileSize() final { return base_->GetFileSize(); }
};
class ManifestFile : public WritableFile {
public:
Expand Down Expand Up @@ -345,6 +346,7 @@ class SpecialEnv : public EnvWrapper {
Status Allocate(uint64_t offset, uint64_t len) override {
return base_->Allocate(offset, len);
}
uint64_t GetFileSize() final { return base_->GetFileSize(); }

private:
SpecialEnv* env_;
Expand Down
2 changes: 1 addition & 1 deletion include/rocksdb/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ class WritableFile {
/*
* Get the size of valid data in the file.
*/
virtual uint64_t GetFileSize() { return 0; }
virtual uint64_t GetFileSize() = 0;

/*
* Get and set the default pre-allocation block size for writes to
Expand Down
1 change: 1 addition & 0 deletions utilities/fault_injection_env.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class TestWritableFile : public WritableFile {
virtual bool use_direct_io() const override {
return target_->use_direct_io();
};
uint64_t GetFileSize() final { return target_->GetFileSize(); }

private:
FileState state_;
Expand Down

0 comments on commit ff4a5ee

Please sign in to comment.