Skip to content

Commit

Permalink
Use virtual inheritance in FileSystem hierarchy.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpetrov4 committed Dec 21, 2023
1 parent 6700da7 commit aa34eb2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/rocksdb/cloud/cloud_file_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ struct CloudManifestDelta {
// NOTE: The AWS SDK must be initialized before the CloudFileSystem is
// constructed, and remain active (Aws::ShutdownAPI() not called) as long as any
// CloudFileSystem objects exist.
class CloudFileSystem : public FileSystem {
class CloudFileSystem : public virtual FileSystem {
protected:
CloudFileSystemOptions cloud_fs_options;
std::shared_ptr<FileSystem> base_fs_; // The underlying file system
Expand Down
3 changes: 1 addition & 2 deletions include/rocksdb/cloud/cloud_file_system_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CloudFileDeletionScheduler;
//
// The Cloud file system
//
class CloudFileSystemImpl : public CloudFileSystem {
class CloudFileSystemImpl : public virtual CloudFileSystem {
friend class CloudFileSystem;

public:
Expand Down Expand Up @@ -236,7 +236,6 @@ class CloudFileSystemImpl : public CloudFileSystem {
"CloudFileSystemImpl::IsDirectory() not supported.");
}


IOStatus Poll(std::vector<void*>& io_handles,
size_t /*min_completions*/) override {
for (auto* handle : io_handles) {
Expand Down
2 changes: 1 addition & 1 deletion include/rocksdb/file_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ class FSDirectory {
// An implementation of Env that forwards all calls to another Env.
// May be useful to clients who wish to override just part of the
// functionality of another Env.
class FileSystemWrapper : public FileSystem {
class FileSystemWrapper : public virtual FileSystem {
public:
// Initialize an EnvWrapper that delegates all calls to *t
explicit FileSystemWrapper(const std::shared_ptr<FileSystem>& t);
Expand Down

0 comments on commit aa34eb2

Please sign in to comment.