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


##########
be/src/http/action/calc_file_crc_action.cpp:
##########
@@ -58,16 +59,28 @@
         return Status::InternalError("convert tablet id or failed, {}", 
e.what());
     }
 
-    TabletSharedPtr tablet = _engine.tablet_manager()->get_tablet(tablet_id);
+    BaseTabletSPtr tablet = nullptr;
+
+    if (auto cloudEngine = dynamic_cast<CloudStorageEngine*>(&_engine)) {
+        tablet = DORIS_TRY(cloudEngine->get_tablet(tablet_id));
+        // sync all rowsets
+        
RETURN_IF_ERROR(std::dynamic_pointer_cast<CloudTablet>(tablet)->sync_rowsets(-1));
+    } else if (auto storageEngine = dynamic_cast<StorageEngine*>(&_engine)) {

Review Comment:
   warning: 'auto storageEngine' can be declared as 'auto *storageEngine' 
[readability-qualified-auto]
   
   ```suggestion
       } else if (auto *storageEngine = dynamic_cast<StorageEngine*>(&_engine)) 
{
   ```
   



##########
be/src/http/action/calc_file_crc_action.cpp:
##########
@@ -58,16 +59,28 @@ Status CalcFileCrcAction::_handle_calc_crc(HttpRequest* 
req, uint32_t* crc_value
         return Status::InternalError("convert tablet id or failed, {}", 
e.what());
     }
 
-    TabletSharedPtr tablet = _engine.tablet_manager()->get_tablet(tablet_id);
+    BaseTabletSPtr tablet = nullptr;
+
+    if (auto cloudEngine = dynamic_cast<CloudStorageEngine*>(&_engine)) {

Review Comment:
   warning: 'auto cloudEngine' can be declared as 'auto *cloudEngine' 
[readability-qualified-auto]
   
   ```suggestion
       if (auto *cloudEngine = dynamic_cast<CloudStorageEngine*>(&_engine)) {
   ```
   



##########
be/src/olap/base_tablet.h:
##########
@@ -252,6 +252,21 @@ class BaseTablet {
                                         const std::vector<RowsetSharedPtr>& 
candidate_rowsets,
                                         int limit);
 
+    void traverse_rowsets(std::function<void(const RowsetSharedPtr&)> visitor,
+                          bool include_stale = false) {
+        std::shared_lock rlock(_meta_lock);
+        for (auto& [v, rs] : _rs_version_map) {
+            visitor(rs);
+        }
+        if (!include_stale) return;

Review Comment:
   warning: statement should be inside braces 
[readability-braces-around-statements]
   
   ```suggestion
           if (!include_stale) { return;
   }
   ```
   



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