gavinchou commented on code in PR #30245: URL: https://github.com/apache/doris/pull/30245#discussion_r1462778719
########## be/src/http/action/meta_action.cpp: ########## @@ -65,28 +67,27 @@ Status MetaAction::_handle_header(HttpRequest* req, std::string* json_meta) { return Status::InternalError("convert failed, {}", e.what()); } - TabletSharedPtr tablet = StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id); - if (tablet == nullptr) { - LOG(WARNING) << "no tablet for tablet_id:" << tablet_id; - return Status::InternalError("no tablet exist"); - } + auto tablet = DORIS_TRY(ExecEnv::get_tablet(tablet_id)); std::string operation = req->param(OP); if (operation == HEADER) { - TabletMetaSharedPtr tablet_meta(new TabletMeta()); + TabletMeta tablet_meta; tablet->generate_tablet_meta_copy(tablet_meta); json2pb::Pb2JsonOptions json_options; json_options.pretty_json = true; json_options.bytes_to_base64 = enable_byte_to_base64; - tablet_meta->to_json(json_meta, json_options); + tablet_meta.to_json(json_meta, json_options); return Status::OK(); } else if (operation == DATA_SIZE) { - EasyJson data_size; - { - std::shared_lock rowset_ldlock(tablet->get_header_lock()); - data_size["local_data_size"] = tablet->tablet_local_size(); - data_size["remote_data_size"] = tablet->tablet_remote_size(); + if (!config::is_cloud_mode()) { Review Comment: add a comment to desc why cloud mode doesn't support this API ########## be/src/olap/storage_engine.h: ########## @@ -72,35 +71,97 @@ class TxnManager; class ReportWorker; class CreateTabletIdxCache; struct DirInfo; +class SnapshotManager; using SegCompactionCandidates = std::vector<segment_v2::SegmentSharedPtr>; using SegCompactionCandidatesSharedPtr = std::shared_ptr<SegCompactionCandidates>; +class StorageEngine; +class CloudStorageEngine; + // StorageEngine singleton to manage all Table pointers. // Providing add/drop/get operations. // StorageEngine instance doesn't own the Table resources, just hold the pointer, // allocation/deallocation must be done outside. -class StorageEngine { +class BaseStorageEngine { +protected: + enum Type : uint8_t { + LOCAL, // Shared-nothing integrated compute and storage architecture + CLOUD, // Separating compute and storage architecture + }; + Type _type; + +public: + BaseStorageEngine(Type type, const UniqueId& backend_uid); + virtual ~BaseStorageEngine(); + + StorageEngine& to_local(); + CloudStorageEngine& to_cloud(); + + virtual Status open() = 0; Review Comment: naming `open()` -> `start()` -- 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