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


##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,22 @@ static const std::string kTestDir = 
"./ut_dir/tablet_cooldown_test";
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class RemoteFileSystemMock;
+class FileWriterMock;
+
+static io::FileSystemSPtr s_fs(new RemoteFileSystemMock("test_path", 
std::to_string(kResourceId),

Review Comment:
   warning: allocation of incomplete type 'doris::RemoteFileSystemMock' 
[clang-diagnostic-error]
   ```cpp
   static io::FileSystemSPtr s_fs(new RemoteFileSystemMock("test_path", 
std::to_string(kResourceId),
                                      ^
   ```
   **be/test/olap/tablet_cooldown_test.cpp:45:** forward declaration of 
'doris::RemoteFileSystemMock'
   ```cpp
   class RemoteFileSystemMock;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +43,22 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+class RemoteFileSystemMock;
+class FileWriterMock;
+
+static io::FileSystemSPtr s_fs(new RemoteFileSystemMock("test_path", 
std::to_string(kResourceId),
+                                                       
io::FileSystemType::S3));
+static io::FileWriterPtr s_writer(new FileWriterMock("test_path"));

Review Comment:
   warning: allocation of incomplete type 'doris::FileWriterMock' 
[clang-diagnostic-error]
   ```cpp
   static io::FileWriterPtr s_writer(new FileWriterMock("test_path"));
                                         ^
   ```
   **be/test/olap/tablet_cooldown_test.cpp:46:** forward declaration of 
'doris::FileWriterMock'
   ```cpp
   class FileWriterMock;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -85,6 +88,102 @@
             k_engine = nullptr;
         }
     }
+
+};
+
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}

Review Comment:
   warning: use '= default' to define a trivial destructor 
[modernize-use-equals-default]
   
   ```suggestion
       ~FileWriterMock() = default;
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -85,6 +88,102 @@
             k_engine = nullptr;
         }
     }
+
+};
+
+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; }
+
+    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;

Review Comment:
   warning: overload resolution selected deleted operator '=' 
[clang-diagnostic-error]
   ```cpp
           *writer = s_writer;
                   ^
   ```
   **/usr/include/c++/11/bits/unique_ptr.h:468:** candidate function has been 
explicitly deleted
   ```cpp
         unique_ptr& operator=(const unique_ptr&) = delete;
                     ^
   ```
   **/usr/include/c++/11/bits/unique_ptr.h:370:** candidate function not 
viable: expects an rvalue for 1st argument
   ```cpp
         unique_ptr& operator=(unique_ptr&&) = default;
                     ^
   ```
   **/usr/include/c++/11/bits/unique_ptr.h:385:** candidate function [with _Up 
= doris::io::FileWriter, _Ep = std::default_delete<doris::io::FileWriter>] not 
viable: expects an rvalue for 1st argument
   ```cpp
        operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
    ^
   ```
   **/usr/include/c++/11/bits/unique_ptr.h:394:** candidate function not 
viable: no known conversion from 'io::FileWriterPtr' (aka 
'unique_ptr<doris::io::FileWriter>') to 'std::nullptr_t' for 1st argument
   ```cpp
         operator=(nullptr_t) noexcept
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -85,6 +88,102 @@
             k_engine = nullptr;
         }
     }
+
+};
+
+class FileWriterMock : public io::FileWriter {
+public:
+    FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+
+    ~FileWriterMock() {}

Review Comment:
   warning: annotate this function with 'override' or (rarely) 'final' 
[modernize-use-override]
   
   ```suggestion
       ~FileWriterMock() override {}
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -85,6 +88,102 @@
             k_engine = nullptr;
         }
     }
+
+};
+
+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; }
+
+    FileSystemSPtr fs() const override { return fs; }

Review Comment:
   warning: unknown type name 'FileSystemSPtr'; did you mean 
'io::FileSystemSPtr'? [clang-diagnostic-error]
   
   ```suggestion
       io::FileSystemSPtr fs() const override { return fs; }
   ```
   **be/src/io/fs/file_system.h:85:** 'io::FileSystemSPtr' declared here
   ```cpp
   using FileSystemSPtr = std::shared_ptr<FileSystem>;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -85,6 +88,102 @@
             k_engine = nullptr;
         }
     }
+
+};
+
+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; }
+
+    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
       FileSystemSPtr fs() const override { return fs(); }
   ```
   



-- 
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