github-actions[bot] commented on code in PR #15832: URL: https://github.com/apache/doris/pull/15832#discussion_r1066891772
########## be/src/io/fs/remote_file_system.cpp: ########## @@ -34,10 +34,9 @@ Status RemoteFileSystem::open_file(const Path& path, const FileReaderOptions& re *reader = raw_reader; break; } - case io::FileCachePolicy::SUB_FILE_CACHE: - case io::FileCachePolicy::WHOLE_FILE_CACHE: { - StringPiece str(path.native()); - std::string cache_path = reader_options.path_policy.get_cache_path(str.as_string()); + case io::FileCacheType::SUB_FILE_CACHE: Review Comment: warning: no member named 'FileCacheType' in namespace 'doris::io' [clang-diagnostic-error] ```cpp case io::FileCacheType::SUB_FILE_CACHE: ^ ``` ########## be/src/io/fs/remote_file_system.cpp: ########## @@ -34,10 +34,9 @@ *reader = raw_reader; break; } - case io::FileCachePolicy::SUB_FILE_CACHE: - case io::FileCachePolicy::WHOLE_FILE_CACHE: { - StringPiece str(path.native()); - std::string cache_path = reader_options.path_policy.get_cache_path(str.as_string()); + case io::FileCacheType::SUB_FILE_CACHE: + case io::FileCacheType::WHOLE_FILE_CACHE: { Review Comment: warning: no member named 'FileCacheType' in namespace 'doris::io' [clang-diagnostic-error] ```cpp case io::FileCacheType::WHOLE_FILE_CACHE: { ^ ``` ########## be/src/olap/rowset/beta_rowset.cpp: ########## @@ -156,7 +165,11 @@ } auto seg_path = segment_file_path(seg_id); std::shared_ptr<segment_v2::Segment> segment; - auto s = segment_v2::Segment::open(fs, seg_path, seg_id, rowset_id(), _schema, &segment); + io::FileReaderOptions reader_options(io::cache_type_from_string(config::file_cache_type), + io::SegmentCachePathPolicy()); + reader_options.path_policy.cache_path = segment_cache_path(seg_id); Review Comment: warning: no viable overloaded '=' [clang-diagnostic-error] ```cpp reader_options.path_policy.cache_path = segment_cache_path(seg_id); ^ ``` **/usr/include/c++/11/bits/basic_string.h:678:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(const basic_string& __str) ^ ``` **/usr/include/c++/11/bits/basic_string.h:688:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(const _CharT* __s) ^ ``` **/usr/include/c++/11/bits/basic_string.h:699:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(_CharT __c) ^ ``` **/usr/include/c++/11/bits/basic_string.h:716:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(basic_string&& __str) ^ ``` **/usr/include/c++/11/bits/basic_string.h:784:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(initializer_list<_CharT> __l) ^ ``` **/usr/include/c++/11/bits/basic_string.h:798:** candidate function template not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(const _Tp& __svt) ^ ``` ########## be/src/olap/rowset/beta_rowset.cpp: ########## @@ -326,7 +339,11 @@ for (int seg_id = 0; seg_id < num_segments(); ++seg_id) { auto seg_path = segment_file_path(seg_id); std::shared_ptr<segment_v2::Segment> segment; - auto s = segment_v2::Segment::open(fs, seg_path, seg_id, rowset_id(), _schema, &segment); + io::FileReaderOptions reader_options(io::cache_type_from_string(config::file_cache_type), + io::SegmentCachePathPolicy()); + reader_options.path_policy.cache_path = segment_cache_path(seg_id); Review Comment: warning: no viable overloaded '=' [clang-diagnostic-error] ```cpp reader_options.path_policy.cache_path = segment_cache_path(seg_id); ^ ``` **/usr/include/c++/11/bits/basic_string.h:678:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(const basic_string& __str) ^ ``` **/usr/include/c++/11/bits/basic_string.h:688:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(const _CharT* __s) ^ ``` **/usr/include/c++/11/bits/basic_string.h:699:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(_CharT __c) ^ ``` **/usr/include/c++/11/bits/basic_string.h:716:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(basic_string&& __str) ^ ``` **/usr/include/c++/11/bits/basic_string.h:784:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(initializer_list<_CharT> __l) ^ ``` **/usr/include/c++/11/bits/basic_string.h:798:** candidate function template not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(const _Tp& __svt) ^ ``` ########## be/src/olap/rowset/beta_rowset.cpp: ########## @@ -134,7 +139,11 @@ Status BetaRowset::load_segments(std::vector<segment_v2::SegmentSharedPtr>* segm for (int seg_id = 0; seg_id < num_segments(); ++seg_id) { auto seg_path = segment_file_path(seg_id); std::shared_ptr<segment_v2::Segment> segment; - auto s = segment_v2::Segment::open(fs, seg_path, seg_id, rowset_id(), _schema, &segment); + io::FileReaderOptions reader_options(io::cache_type_from_string(config::file_cache_type), + io::SegmentCachePathPolicy()); + reader_options.path_policy.cache_path = segment_cache_path(seg_id); Review Comment: warning: no viable overloaded '=' [clang-diagnostic-error] ```cpp reader_options.path_policy.cache_path = segment_cache_path(seg_id); ^ ``` **/usr/include/c++/11/bits/basic_string.h:678:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(const basic_string& __str) ^ ``` **/usr/include/c++/11/bits/basic_string.h:688:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(const _CharT* __s) ^ ``` **/usr/include/c++/11/bits/basic_string.h:699:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(_CharT __c) ^ ``` **/usr/include/c++/11/bits/basic_string.h:716:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(basic_string&& __str) ^ ``` **/usr/include/c++/11/bits/basic_string.h:784:** candidate function not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(initializer_list<_CharT> __l) ^ ``` **/usr/include/c++/11/bits/basic_string.h:798:** candidate function template not viable: 'this' argument has type 'const std::string' (aka 'const basic_string<char>'), but method is not marked const ```cpp operator=(const _Tp& __svt) ^ ``` ########## be/src/olap/tablet.cpp: ########## @@ -1729,18 +1757,118 @@ Status Tablet::cooldown() { has_shutdown = tablet_state() == TABLET_SHUTDOWN; if (!has_shutdown) { modify_rowsets(to_add, to_delete); - _self_owned_remote_rowsets.insert(to_add.front()); + if (!config::cooldown_single_remote_file) { + _self_owned_remote_rowsets.insert(to_add.front()); + } save_meta(); } } - if (has_shutdown) { + if (has_shutdown && !config::cooldown_single_remote_file) { record_unused_remote_rowset(new_rowset_id, dest_fs->resource_id(), to_add.front()->num_segments()); return Status::Aborted("tablet {} has shutdown", tablet_id()); } return Status::OK(); } +Status Tablet::_read_remote_tablet_meta(FileSystemSPtr fs, TabletMetaPB* tablet_meta_pb) { + std::string remote_meta_path = BetaRowset::remote_tablet_meta_path( + tablet_id(), _tablet_meta->cooldown_replica_id()); + bool exist = false; + RETURN_IF_ERROR(fs->exists(remote_meta_path, &exist)); + if (exist) { + io::FileReaderSPtr tablet_meta_reader; + RETURN_IF_ERROR(fs->open_file(remote_meta_path, &tablet_meta_reader)); + if (tablet_meta_reader == nullptr) { + return Status::InternalError("tablet_meta_reader is null"); Review Comment: warning: no matching member function for call to 'open_file' [clang-diagnostic-error] ```cpp RETURN_IF_ERROR(fs->open_file(remote_meta_path, &tablet_meta_reader)); ^ ``` **be/src/common/status.h:487:** expanded from macro 'RETURN_IF_ERROR' ```cpp Status _status_ = (stmt); \ ^ ``` **be/src/io/fs/file_system.h:58:** candidate function not viable: requires 3 arguments, but 2 were provided ```cpp virtual Status open_file(const Path& path, FileReaderSPtr* reader, IOContext* io_ctx) = 0; ^ ``` **be/src/io/fs/file_system.h:55:** candidate function not viable: requires 4 arguments, but 2 were provided ```cpp virtual Status open_file(const Path& path, const FileReaderOptions& reader_options, ^ ``` -- 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