yiguolei commented on code in PR #22442: URL: https://github.com/apache/doris/pull/22442#discussion_r1299586077
########## be/src/olap/rowset/rowset_meta_manager.cpp: ########## @@ -443,25 +443,51 @@ Status RowsetMetaManager::traverse_rowset_metas( std::function<bool(const TabletUid&, const RowsetId&, const std::string&)> const& func) { auto traverse_rowset_meta_func = [&func](const std::string& key, const std::string& value) -> bool { - std::vector<std::string> parts; - // key format: rst_uuid_rowset_id - split_string<char>(key, '_', &parts); - if (parts.size() != 3) { - LOG(WARNING) << "invalid rowset key:" << key << ", splitted size:" << parts.size(); + std::pair<TabletUid, RowsetId> res; + if (!_get_tablet_id_and_rowset_id(key, &res)) { return true; } - RowsetId rowset_id; - rowset_id.init(parts[2]); - std::vector<std::string> uid_parts; - split_string<char>(parts[1], '-', &uid_parts); - TabletUid tablet_uid(uid_parts[0], uid_parts[1]); - return func(tablet_uid, rowset_id, value); + return func(res.first, res.second, value); }; Status status = meta->iterate(META_COLUMN_FAMILY_INDEX, ROWSET_PREFIX, traverse_rowset_meta_func); return status; } +Status RowsetMetaManager::traverse_rowset_metas_with_write( Review Comment: 不要写这个函数,这个函数不会长期存在,你写完这个功能后,这个函数很快就要删掉。 ########## be/src/olap/rowset/rowset_meta_manager.cpp: ########## @@ -443,25 +443,51 @@ Status RowsetMetaManager::traverse_rowset_metas( std::function<bool(const TabletUid&, const RowsetId&, const std::string&)> const& func) { auto traverse_rowset_meta_func = [&func](const std::string& key, const std::string& value) -> bool { - std::vector<std::string> parts; - // key format: rst_uuid_rowset_id - split_string<char>(key, '_', &parts); - if (parts.size() != 3) { - LOG(WARNING) << "invalid rowset key:" << key << ", splitted size:" << parts.size(); + std::pair<TabletUid, RowsetId> res; + if (!_get_tablet_id_and_rowset_id(key, &res)) { return true; } - RowsetId rowset_id; - rowset_id.init(parts[2]); - std::vector<std::string> uid_parts; - split_string<char>(parts[1], '-', &uid_parts); - TabletUid tablet_uid(uid_parts[0], uid_parts[1]); - return func(tablet_uid, rowset_id, value); + return func(res.first, res.second, value); }; Status status = meta->iterate(META_COLUMN_FAMILY_INDEX, ROWSET_PREFIX, traverse_rowset_meta_func); return status; } +Status RowsetMetaManager::traverse_rowset_metas_with_write( Review Comment: 不要写这个函数,这个函数不会长期存在,你写完这个功能后,这个函数很快就要删掉。 -- 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