github-actions[bot] commented on code in PR #17246: URL: https://github.com/apache/doris/pull/17246#discussion_r1125997659
########## be/test/olap/tablet_cooldown_test.cpp: ########## @@ -37,25 +41,150 @@ namespace doris { static StorageEngine* k_engine = nullptr; -static const std::string kTestDir = "./ut_dir/tablet_cooldown_test"; +static const std::string kTestDir = "ut_dir/tablet_cooldown_test"; static constexpr int64_t kResourceId = 10000; static constexpr int64_t kStoragePolicyId = 10002; +static constexpr int64_t kTabletId = 10005; +static constexpr int64_t kTabletId2 = 10006; +static constexpr int64_t kReplicaId = 10009; +static constexpr int32_t kSchemaHash = 270068377; +static constexpr int64_t kReplicaId2 = 10010; +static constexpr int32_t kSchemaHash2 = 270068381; + +static constexpr int32_t kTxnId = 20003; +static constexpr int32_t kPartitionId = 30003; +static constexpr int32_t kTxnId2 = 40003; +static constexpr int32_t kPartitionId2 = 50003; + +using io::Path; + +static io::FileSystemSPtr s_fs; + +static std::string get_remote_path(const Path& path) { + return fmt::format("{}/remote/{}", config::storage_root_path, path.string()); +} + +class FileWriterMock : public io::FileWriter { +public: + FileWriterMock(Path path) : io::FileWriter(std::move(path)) { + io::global_local_filesystem()->create_file(get_remote_path(_path), &_local_file_writer); + } + + ~FileWriterMock() override = default; + + Status close() override { return _local_file_writer->close(); } + + Status abort() override { return _local_file_writer->abort(); } + + Status append(const Slice& data) override { + printf("append: %s\n", _path.string().c_str()); 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 printf("append: %s\n", path().string().c_str()); ``` ########## be/test/olap/tablet_cooldown_test.cpp: ########## @@ -37,25 +41,150 @@ static StorageEngine* k_engine = nullptr; -static const std::string kTestDir = "./ut_dir/tablet_cooldown_test"; +static const std::string kTestDir = "ut_dir/tablet_cooldown_test"; static constexpr int64_t kResourceId = 10000; static constexpr int64_t kStoragePolicyId = 10002; +static constexpr int64_t kTabletId = 10005; +static constexpr int64_t kTabletId2 = 10006; +static constexpr int64_t kReplicaId = 10009; +static constexpr int32_t kSchemaHash = 270068377; +static constexpr int64_t kReplicaId2 = 10010; +static constexpr int32_t kSchemaHash2 = 270068381; + +static constexpr int32_t kTxnId = 20003; +static constexpr int32_t kPartitionId = 30003; +static constexpr int32_t kTxnId2 = 40003; +static constexpr int32_t kPartitionId2 = 50003; + +using io::Path; + +static io::FileSystemSPtr s_fs; + +static std::string get_remote_path(const Path& path) { + return fmt::format("{}/remote/{}", config::storage_root_path, path.string()); +} + +class FileWriterMock : public io::FileWriter { +public: + FileWriterMock(Path path) : io::FileWriter(std::move(path)) { + io::global_local_filesystem()->create_file(get_remote_path(_path), &_local_file_writer); + } + + ~FileWriterMock() override = default; + + Status close() override { return _local_file_writer->close(); } + + Status abort() override { return _local_file_writer->abort(); } + + Status append(const Slice& data) override { + printf("append: %s\n", _path.string().c_str()); + return _local_file_writer->append(data); + } + + Status appendv(const Slice* data, size_t data_cnt) override { + printf("appendv: %s\n", _path.string().c_str()); 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 printf("appendv: %s\n", path().string().c_str()); ``` ########## be/test/olap/tablet_cooldown_test.cpp: ########## @@ -37,25 +41,150 @@ static StorageEngine* k_engine = nullptr; -static const std::string kTestDir = "./ut_dir/tablet_cooldown_test"; +static const std::string kTestDir = "ut_dir/tablet_cooldown_test"; static constexpr int64_t kResourceId = 10000; static constexpr int64_t kStoragePolicyId = 10002; +static constexpr int64_t kTabletId = 10005; +static constexpr int64_t kTabletId2 = 10006; +static constexpr int64_t kReplicaId = 10009; +static constexpr int32_t kSchemaHash = 270068377; +static constexpr int64_t kReplicaId2 = 10010; +static constexpr int32_t kSchemaHash2 = 270068381; + +static constexpr int32_t kTxnId = 20003; +static constexpr int32_t kPartitionId = 30003; +static constexpr int32_t kTxnId2 = 40003; +static constexpr int32_t kPartitionId2 = 50003; + +using io::Path; + +static io::FileSystemSPtr s_fs; + +static std::string get_remote_path(const Path& path) { + return fmt::format("{}/remote/{}", config::storage_root_path, path.string()); +} + +class FileWriterMock : public io::FileWriter { +public: + FileWriterMock(Path path) : io::FileWriter(std::move(path)) { + io::global_local_filesystem()->create_file(get_remote_path(_path), &_local_file_writer); + } + + ~FileWriterMock() override = default; + + Status close() override { return _local_file_writer->close(); } + + Status abort() override { return _local_file_writer->abort(); } + + Status append(const Slice& data) override { + printf("append: %s\n", _path.string().c_str()); + return _local_file_writer->append(data); + } + + Status appendv(const Slice* data, size_t data_cnt) override { + printf("appendv: %s\n", _path.string().c_str()); + return _local_file_writer->appendv(data, data_cnt); + } + + Status write_at(size_t offset, const Slice& data) override { + printf("write_at: %s\n", _path.string().c_str()); 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 printf("write_at: %s\n", path().string().c_str()); ``` -- 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