github-actions[bot] commented on code in PR #17246:
URL: https://github.com/apache/doris/pull/17246#discussion_r1121575529


##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@ static const std::string kTestDir = 
"./ut_dir/tablet_cooldown_test";
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       FileWriterMock(io::Path path) : io::FileWriter(std::move(path)) {}
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }

Review Comment:
   warning: reference to non-static member function must be called; did you 
mean to call it with no arguments? [clang-diagnostic-error]
   
   ```suggestion
       io::FileSystemSPtr fs() const override { return fs(); }
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status create_file(const io::Path& path, io::FileWriterPtr* writer) 
override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status open_file(const io::Path& path, io::FileReaderSPtr* reader, 
IOContext* io_ctx) override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status link_file(const Path& src, const Path& dest) override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status link_file(const Path& src, const io::Path& dest) override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status link_file(const Path& src, const Path& dest) override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status link_file(const io::Path& src, const Path& dest) override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status link_file(const Path& src, const Path& dest) override {
+        return Status::OK();
+    }
+
+    Status exists(const Path& path, bool* res) const override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status exists(const io::Path& path, bool* res) const override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status link_file(const Path& src, const Path& dest) override {
+        return Status::OK();
+    }
+
+    Status exists(const Path& path, bool* res) const override {
+        return Status::OK();
+    }
+
+    Status file_size(const Path& path, size_t* file_size) const override {
+        return Status::OK();
+    }
+
+    Status list(const Path& path, std::vector<Path>* files) override {
+        return Status::OK();
+    }
+
+    Status upload(const Path& local_path, const Path& dest_path) override {
+        return Status::OK();
+    }
+
+    Status batch_upload(const std::vector<Path>& local_paths,

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status batch_upload(const std::vector<io::Path>& local_paths,
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status link_file(const Path& src, const Path& dest) override {
+        return Status::OK();
+    }
+
+    Status exists(const Path& path, bool* res) const override {
+        return Status::OK();
+    }
+
+    Status file_size(const Path& path, size_t* file_size) const override {
+        return Status::OK();
+    }
+
+    Status list(const Path& path, std::vector<Path>* files) override {
+        return Status::OK();
+    }
+
+    Status upload(const Path& local_path, const Path& dest_path) override {
+        return Status::OK();
+    }
+
+    Status batch_upload(const std::vector<Path>& local_paths,
+                        const std::vector<Path>& dest_paths) override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
                           const std::vector<io::Path>& dest_paths) override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       RemoteFileSystemMock(io::Path root_path, std::string&& id, 
io::FileSystemType type)
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status delete_file(const io::Path& path) override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status delete_directory(const io::Path& path) override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status create_directory(const io::Path& path) override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status link_file(const Path& src, const Path& dest) override {
+        return Status::OK();
+    }
+
+    Status exists(const Path& path, bool* res) const override {
+        return Status::OK();
+    }
+
+    Status file_size(const Path& path, size_t* file_size) const override {
+        return Status::OK();
+    }
+
+    Status list(const Path& path, std::vector<Path>* files) override {

Review Comment:
   warning: use of undeclared identifier 'Path'; did you mean 'path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status list(const Path& path, std::vector<path>* files) override {
   ```
   **be/test/olap/tablet_cooldown_test.cpp:118:** 'path' declared here
   ```cpp
       Status list(const Path& path, std::vector<Path>* files) override {
                               ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status link_file(const Path& src, const Path& dest) override {
+        return Status::OK();
+    }
+
+    Status exists(const Path& path, bool* res) const override {
+        return Status::OK();
+    }
+
+    Status file_size(const Path& path, size_t* file_size) const override {
+        return Status::OK();
+    }
+
+    Status list(const Path& path, std::vector<Path>* files) override {

Review Comment:
   warning: template argument for template type parameter must be a type 
[clang-diagnostic-error]
   ```cpp
       Status list(const Path& path, std::vector<Path>* files) override {
                                                 ^
   ```
   **/usr/include/c++/11/bits/stl_vector.h:387:** template parameter is 
declared here
   ```cpp
     template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
                       ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status link_file(const Path& src, const Path& dest) override {
+        return Status::OK();
+    }
+
+    Status exists(const Path& path, bool* res) const override {
+        return Status::OK();
+    }
+
+    Status file_size(const Path& path, size_t* file_size) const override {
+        return Status::OK();
+    }
+
+    Status list(const Path& path, std::vector<Path>* files) override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status list(const io::Path& path, std::vector<Path>* files) override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status link_file(const Path& src, const Path& dest) override {
+        return Status::OK();
+    }
+
+    Status exists(const Path& path, bool* res) const override {
+        return Status::OK();
+    }
+
+    Status file_size(const Path& path, size_t* file_size) const override {
+        return Status::OK();
+    }
+
+    Status list(const Path& path, std::vector<Path>* files) override {
+        return Status::OK();
+    }
+
+    Status upload(const Path& local_path, const Path& dest_path) override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status upload(const io::Path& local_path, const Path& dest_path) 
override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status link_file(const Path& src, const Path& dest) override {
+        return Status::OK();
+    }
+
+    Status exists(const Path& path, bool* res) const override {
+        return Status::OK();
+    }
+
+    Status file_size(const Path& path, size_t* file_size) const override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status file_size(const io::Path& path, size_t* file_size) const override 
{
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,114 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}
+
+    Status close() override {
+        return Status::OK();
+    }
+
+    Status abort() override {
+        return Status::OK();
+    }
+
+    Status append(const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status appendv(const Slice* data, size_t data_cnt) override {
+        return Status::OK();
+    }
+
+    Status write_at(size_t offset, const Slice& data) override {
+        return Status::OK();
+    }
+
+    Status finalize() override {
+        return Status::OK();
+    }
+
+    size_t bytes_appended() const override { return 0; }
+
+    io::FileSystemSPtr fs() const override { return fs; }
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+    RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType 
type)
+            : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+    ~RemoteFileSystemMock() override {}
+
+    Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+        *writer = s_writer;
+        return Status::OK();
+    }
+
+    Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* 
io_ctx) override {
+        return Status::OK();
+    }
+
+    Status delete_file(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status create_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status delete_directory(const Path& path) override {
+        return Status::OK();
+    }
+
+    Status link_file(const Path& src, const Path& dest) override {
+        return Status::OK();
+    }
+
+    Status exists(const Path& path, bool* res) const override {
+        return Status::OK();
+    }
+
+    Status file_size(const Path& path, size_t* file_size) const override {
+        return Status::OK();
+    }
+
+    Status list(const Path& path, std::vector<Path>* files) override {
+        return Status::OK();
+    }
+
+    Status upload(const Path& local_path, const Path& dest_path) override {

Review Comment:
   warning: unknown type name 'Path'; did you mean 'io::Path'? 
[clang-diagnostic-error]
   
   ```suggestion
       Status upload(const Path& local_path, const io::Path& dest_path) 
override {
   ```
   **be/src/io/fs/path.h:24:** 'io::Path' declared here
   ```cpp
   using Path = std::filesystem::path;
         ^
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org


Reply via email to